/* =========================================
   IP 页面整体容器（隔离所有深色样式）
========================================= */
.ip-page {
    background: radial-gradient(circle at 20% 20%, #1c1d22, #0e0f11 70%);
    color: #e6e6e6;
    padding-bottom: 40px;
}

/* =========================================
   标题
========================================= */
.ip-page .page-title {
    text-align: center;
    font-size: 30px;
    font-weight: 700;
    margin: 25px auto 8px;
    color: #e8e8e8;
}

.ip-page .page-desc {
    text-align: center;
    color: #8b8d93;
    margin-bottom: 20px;
}

/* =========================================
   顶部 IP Hero 卡片
========================================= */
.ip-page .ip-hero-main {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}


.ip-page .ip-hero {
    background: linear-gradient(135deg, #1b1c20, #151619);
    border-radius: 14px;
    padding: 24px;
    margin: 30px auto;
    width: 92%;
    max-width: 960px;
    box-shadow: 0 0 20px rgba(0, 150, 255, 0.18);
}

.ip-page .ip-hero-main {
    text-align: center;
    margin-bottom: 22px;
}

.ip-page .ip-hero-main-title {
    color: #8b8d93;
    font-weight: 800;
    font-size: 25px;
    margin-bottom: 6px;
    letter-spacing: 1px;
}

.ip-page .ip-hero-main-ip {
    font-size: 38px;
    font-weight: 800;
    color: #2eb3ff;
}

.ip-page .ip-hero-main-country {
    font-size: 25px;
    font-weight: 600;
    margin-top: 6px;
    letter-spacing: 1px;
    color: #4ec9b0;
}

.ip-page .ip-hero-main-localtime {
    margin-top: 5px;
    color: #5cb8ff;
    font-size: 14px;
}

/* 复制按钮 */
.ip-page .ip-hero-copy {
    margin-left: 10px;
    padding: 6px 12px;
    border-radius: 10px;
    border: none;
    background: #2ea8ff33;
    color: #39b9ff;
    cursor: pointer;
    transition: 0.25s;
}
.ip-page .ip-hero-copy:hover {
    background: #2ea8ff55;
}


/* 让 IP 行永远不超出容器 */
.ip-page .ip-hero-main-ip-row{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;         /* ✅ 不够宽就自动换行 */
  max-width: 100%;
}

/* 让 IP 文本可收缩、可换行 */
.ip-page .ip-hero-main-ip{
  max-width: 100%;
  overflow-wrap: anywhere; /* ✅ 极端情况下也能断行 */
  word-break: break-word;
}

/* 复制按钮不要把布局撑爆 */
.ip-page .ip-hero-copy{
  flex: 0 0 auto;
  max-width: 100%;
}

/* =========================================
   Hero 信息表
========================================= */
.ip-page .ip-hero-table {
    margin-top: 15px;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.ip-page .ip-hero-col {
    flex: 1;
    min-width: 280px;
}

.ip-page .ip-hero-stat-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    align-items: flex-start;    /* 避免多行时垂直居中错位 */
    color: #8b8d93;
}

.ip-page .ip-hero-stat-value {
    color: #ffffff;
    flex: 1;                    /* ✅ 关键：占用剩余空间 */
    word-break: break-word;     /* ✅ 长英文在单词内断行 */
}

/*国旗*/
.ip-hero-main-ip-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ip-flag {
  width: 27px;
  height: 19px;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.2);
  object-fit: cover;
}

//


/* 仅控制“运营商：”这三个字不换行 */
.ip-hero-stat-label {
  white-space: nowrap;   /* ✅ 不允许换行 */
}


/* Badge */
.ip-page .ip-hero-badge-ok {
    padding: 4px 8px;
    border-radius: 6px;
    background: #3bff8122;
    color: #3bff81;
}
.ip-page .ip-hero-badge-danger {
    padding: 4px 8px;
    border-radius: 6px;
    background: #ff2b4d33;
    color: #ff557a;
}
.ip-page .ip-hero-badge-brand {
    padding: 4px 8px;
    border-radius: 6px;
    background: #9f6bff33;
    color: #d7b8ff;
}

/* =========================================
   IP 风险评分条
========================================= */
.ip-page .ip-score-wrapper {
    margin-top: 20px;
}

.ip-page .ip-score-text-left {
    font-size: 15px;
}

.ip-page .ip-score-text-right {
    margin-top: 6px;
    font-size: 13px;
    color: #8b8d93;
}

.ip-page .ip-score-bar {
    margin-top: 6px;
    height: 10px;
    width: 100%;
    background: #333;
    border-radius: 10px;
    overflow: hidden;
}
.ip-page .ip-score-bar-inner {
    height: 100%;
    background: linear-gradient(90deg, #22ff44, #ffaa00, #ff2255);
    transition: 0.8s;
}

/* =========================================
   两列布局
========================================= */
.ip-page .ip-tools-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    width: 92%;
    max-width: 1200px;
    margin: 25px auto;
}

/* 卡片 */
.ip-page .ip-card {
    background: #181a1f;
    padding: 20px;
    border-radius: 14px;
    box-shadow: 0 0 12px rgba(0,0,0,0.4);
}

/* =========================================
   输入区
========================================= */
.ip-page .ip-input-row {
    display: flex;
    gap: 10px;
    margin: 12px 0 16px;
}

.ip-page .ip-input-row input {
    background: #000;
    border: 1px solid #333;
    color: #fff;
    padding: 10px;
    border-radius: 14px;
}

.ip-page .ip-input-row button {
    padding: 10px 18px;
    border-radius: 14px;
    border: none;
    background: #1fb3ff55;
    color: #86d8ff;
    cursor: pointer;
}
.ip-page .ip-input-row button:hover {
    background: #1fb3ff88;
}

/* =========================================
   查询结果区域
========================================= */
.ip-page .ip-result-grid {
    margin-top: 10px;
    color: #ffffff;
}
.ip-page .ip-result-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 6px;
    border-bottom: 1px solid #2c2d31;
}

.ip-page .ip-result-label {
    color: #9ca3af;
}

.ip-page .ip-result-value {
    color: #ffffff;
}

.ip-page .ip-result-actions {
    margin-top: 15px;
    display: flex;
    gap: 10px;
}

.ip-page .ip-action-link {
    padding: 8px 12px;
    border-radius: 14px;
    background: #1f253055;
    border: 1px solid #333;
    color: #8bd4ff;
    cursor: pointer;
}

/* =========================================
   地图 / 雷达图
========================================= */
.ip-page #ip-map {
    width: 100%;
    height: 320px;
    border-radius: 14px;
    margin-top: 20px;
    box-shadow: 0 0 12px #0004;
}

.ip-page #riskRadar {
    width: 100%;
    height: 360px;
    margin-top: 25px;
}

/* =========================================
   AI 风险报告
========================================= */
.ip-page #ai-risk-report {
    padding: 20px;
    background: #202228;
    border-radius: 14px;
    color: #d1d5db;
    margin-top: 20px;
    box-shadow: 0 0 12px rgba(0,0,0,0.5);
}
.ip-page #ai-risk-report h3 {
    margin-bottom: 12px;
    color: #cee8ff;
}
.ip-page #ai-report-text {
    font-size: 15px;
    line-height: 1.6;
    color: #c9c9c9;
}

/* =========================================
   统一 IP 页面内容宽度，使之与顶部卡片等宽
========================================= */
.ip-container {
    width: 92%;
    max-width: 960px;          /* 与 ip-hero 完全一致 */
    margin: 25px auto;         /* 居中并保持页面间隔 */
    box-sizing: border-box;
}

/* =========================================
   调整工具区布局为单列上下显示（默认是两列）
========================================= */
.ip-tools-layout {
    display: block !important; /* 强制覆盖两列布局 */
    width: 100%;
    max-width: 960px;          /* 与顶部保持一致 */
    margin: 0 auto;            /* 居中 */
}

/* =========================================
   调整卡片宽度，让其自动填满容器
========================================= */
.ip-card {
    width: 100%;
    box-sizing: border-box;    /* 防止内容溢出 */
}

/* =========================================
   内容整体视觉优化（可选，但推荐）
========================================= */
.ip-card + .ip-card {
    margin-top: 25px;          /* 卡片之间加入垂直间隔 */
}

/* 搜索框按钮更协调（可选） */
.ip-input-row input {
    width: 100%;
    flex: 1;
}

.ip-input-row button {
    flex-shrink: 0;
}

/* 结果区更整齐（可选） */
.ip-result-grid {
    width: 100%;
}

/* 地图与雷达图保持一致宽度 */
#ip-map,
#riskRadar {
    width: 100% !important;
    max-width: 100%;
}

.device-fp-box {
    margin-top: 18px;
    padding: 14px 16px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.4);
    color: #e5e7eb;
    font-size: 13px;
}

.device-fp-title {
    font-weight: 600;
    margin-bottom: 20px;
    font-size: 25px;
    text-align: center;
    width: 100%;
    display: block;
    letter-spacing: 0.5px;
}

.device-fp-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 32px;
    row-gap: 4px;
}

.device-fp-item {
    padding: 2px 0;
    word-break: break-all;
}

.device-fp-webgl {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(148, 163, 184, 0.4);
    display: flex;
    align-items: flex-start;
    width: 100%;
}

.device-fp-webgl-label {
    font-weight: 600;
    width: 110px;
    white-space: nowrap;
}

.device-fp-webgl-value {
    flex: 1;
    word-break: break-all;
    line-height: 1.4;
}

@media (max-width: 720px) {
    .device-fp-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

/*=======查询历史记录=======*/

/* =========================
   最近查询（localStorage）
========================= */
.ip-page .ip-history {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #2c2d31;
}

.ip-page .ip-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.ip-page .ip-history-title {
  font-size: 14px;
  font-weight: 600;
  color: #d7dbe3;
}

.ip-page .ip-history-clear {
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid #333;
  background: #1f253055;
  color: #8bd4ff;
  cursor: pointer;
}
.ip-page .ip-history-clear:hover {
  background: #1f253088;
}

.ip-page .ip-history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ip-page .ip-history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #2c2d31;
  background: #14161b;
  cursor: pointer;
}

.ip-page .ip-history-item:hover {
  background: #171a20;
  border-color: #3a3b40;
}

.ip-page .ip-history-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.ip-page .ip-history-q {
  font-size: 13px;
  color: #ffffff;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ip-page .ip-history-meta {
  font-size: 12px;
  color: #9ca3af;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ip-page .ip-history-time {
  font-size: 12px;
  color: #8b8d93;
  white-space: nowrap;
  flex-shrink: 0;
}

.ip-page .ip-history-pager{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:10px;
  margin-top:10px;
}

.ip-page .ip-history-pagebtn{
  padding:6px 10px;
  border-radius:10px;
  border:1px solid #333;
  background:#1f253055;
  color:#8bd4ff;
  cursor:pointer;
}

.ip-page .ip-history-pagebtn:disabled{
  opacity:.4;
  cursor:not-allowed;
}

.ip-page .ip-history-pageinfo{
  color:#8b8d93;
  font-size:12px;
}

/* 输入框容器 */
.ip-input-wrap {
  position: relative;
  flex: 1;
}

/* 输入框 */
.ip-input-wrap input {
  width: 100%;
  padding-right: 36px; /* 给 × 留空间 */
}

/* 清除 × 按钮（默认隐藏） */
.ip-input-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);

  width: 20px;
  height: 20px;
  border-radius: 50%;

  border: none;
  background: rgba(255,255,255,0.12);
  color: #9ca3af;

  font-size: 16px;
  line-height: 1;
  cursor: pointer;

  display: none;           /* ⭐ 默认不显示 */
  align-items: center;
  justify-content: center;

  transition: all .15s ease;
}

.ip-input-clear:hover {
  background: rgba(255,255,255,0.25);
  color: #fff;
}
