/* ===================== IP 地址查询页面 ===================== */
.ip-page {
    max-width: 1080px;
    margin: 0 auto;
    padding: 28px 16px 60px;
}

/* ---------- 顶部 ---------- */
.ip-hero { text-align: center; margin-bottom: 24px; }
.ip-title {
    font-size: 30px;
    font-weight: 800;
    margin: 0 0 8px;
    color: var(--text-primary, #1a1a1a);
}
.ip-sub {
    color: var(--text-secondary, #666);
    font-size: 15px;
    margin: 0 0 22px;
}

.ip-search {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
    max-width: 640px;
    margin: 0 auto;
}
.ip-search-input { flex: 1 1 380px; min-width: 240px; }
.ip-input {
    width: 100%;
    font-size: 16px;
    padding: 13px 16px;
    border: 1px solid var(--border-color, #ddd);
    border-radius: 10px;
    background: var(--surface, #fff);
    color: var(--text-primary, #1a1a1a);
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.ip-input:focus {
    border-color: var(--accent, #4a8cff);
    box-shadow: 0 0 0 3px rgba(74, 140, 255, .15);
}

.ip-btn {
    font-size: 15px;
    padding: 12px 22px;
    border-radius: 10px;
    border: 1px solid transparent;
    cursor: pointer;
    font-weight: 600;
    transition: filter .15s, background .15s;
    white-space: nowrap;
}
.ip-btn-primary { background: var(--accent, #4a8cff); color: #fff; }
.ip-btn-primary:hover { filter: brightness(1.05); }
.ip-btn-primary:disabled { opacity: .6; cursor: default; }
.ip-btn-ghost {
    background: transparent;
    color: var(--accent, #4a8cff);
    border-color: var(--border-color, #ddd);
    padding: 8px 14px;
    font-size: 13px;
}
.ip-btn-ghost:hover { border-color: var(--accent, #4a8cff); }

.ip-recent {
    margin-top: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: var(--text-secondary, #666);
}
.ip-recent-label { color: var(--text-secondary, #666); }
.ip-recent-list { display: flex; flex-wrap: wrap; gap: 8px; }
.ip-chip {
    border: 1px solid var(--border-color, #ddd);
    background: var(--surface, #fff);
    color: var(--text-primary, #1a1a1a);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 13px;
    cursor: pointer;
    transition: border-color .15s;
}
.ip-chip:hover { border-color: var(--accent, #4a8cff); color: var(--accent, #4a8cff); }

/* ---------- 面板 / 卡片 ---------- */
.ip-panel {
    background: var(--surface, #fff);
    border: 1px solid var(--border-color, #e5e5e5);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
}
.ip-panel-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}
.ip-panel-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-secondary, #666);
}
.ip-badge {
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    background: var(--accent, #4a8cff);
    border-radius: 999px;
    padding: 3px 10px;
}

/* ---------- 我的 IP ---------- */
.ip-mine { text-align: center; padding: 24px 20px; }
.ip-mine .ip-panel-head { justify-content: center; margin-bottom: 10px; }
.ip-mine-ip {
    font-size: 36px;
    font-weight: 800;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    letter-spacing: .5px;
    color: var(--text-primary, #1a1a1a);
    word-break: break-all;
}
.ip-mine-loc {
    color: var(--text-secondary, #666);
    font-size: 15px;
    margin-top: 8px;
}
.ip-mine-meta {
    color: var(--text-tertiary, #999);
    font-size: 12px;
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 8px;
    justify-content: center;
}

/* ---------- 结果网格 ---------- */
.ip-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.ip-card {
    background: var(--surface, #fff);
    border: 1px solid var(--border-color, #e5e5e5);
    border-radius: 16px;
    padding: 20px;
    min-width: 0;
}
.ip-card-wide { grid-column: 1 / -1; }
.ip-card-loc {
    font-size: 17px;
    font-weight: 700;
    color: var(--accent, #4a8cff);
    margin-bottom: 10px;
}

.ip-row {
    display: flex;
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px dashed var(--border-color, #eee);
    font-size: 14px;
}
.ip-row:last-child { border-bottom: none; }
.ip-k {
    flex: 0 0 96px;
    color: var(--text-secondary, #666);
    flex-shrink: 0;
}
.ip-v {
    flex: 1;
    word-break: break-all;
    color: var(--text-primary, #1a1a1a);
    min-width: 0;
}

/* ---------- 域名解析 ---------- */
.ip-addrs { margin-top: 6px; }
.ip-addr-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px dashed var(--border-color, #eee);
    flex-wrap: wrap;
}
.ip-addr-row:last-child { border-bottom: none; }
.ip-addr {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary, #1a1a1a);
    word-break: break-all;
}
.ip-geo-badge {
    font-size: 12px;
    color: var(--text-secondary, #666);
    background: var(--bg-hover, #f2f2f2);
    border-radius: 999px;
    padding: 4px 10px;
}
.ip-btn-copy {
    margin-left: auto;
    font-size: 12px;
    color: var(--accent, #4a8cff);
    background: transparent;
    border: 1px solid var(--border-color, #ddd);
    border-radius: 8px;
    padding: 4px 12px;
    cursor: pointer;
}
.ip-btn-copy:hover { border-color: var(--accent, #4a8cff); }

.ip-dns-body { margin-top: 4px; }
.ip-dns-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.ip-dns-table th,
.ip-dns-table td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border-color, #eee);
    text-align: left;
    word-break: break-all;
}
.ip-dns-table th {
    color: var(--text-secondary, #666);
    font-weight: 600;
    background: var(--bg-hover, #f7f7f7);
}
.ip-dns-table tr:last-child td { border-bottom: none; }
.ip-dns-type {
    color: var(--accent, #4a8cff);
    font-weight: 700;
    white-space: nowrap;
}

/* ---------- UA ---------- */
.ip-ua-toggle { margin-top: 6px; }
.ip-ua {
    margin: 10px 0 0;
    padding: 12px;
    background: var(--bg-hover, #f7f7f7);
    border-radius: 10px;
    font-size: 12px;
    color: var(--text-secondary, #666);
    word-break: break-all;
    white-space: pre-wrap;
    max-height: 220px;
    overflow: auto;
}

/* ---------- 状态 ---------- */
.ip-status {
    margin: 14px 0;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    text-align: center;
}
.ip-status-info {
    background: rgba(74, 140, 255, .08);
    color: var(--accent, #4a8cff);
}
.ip-status-error {
    background: rgba(255, 77, 79, .08);
    color: #ff4d4f;
}

/* ---------- 平板（≤900px） ---------- */
@media (max-width: 900px) {
    .ip-grid { grid-template-columns: 1fr 1fr; }
    .ip-card-wide { grid-column: 1 / -1; }
}

/* ---------- 手机（≤600px） ---------- */
@media (max-width: 600px) {
    .ip-page {
        padding: 20px 14px 48px;
        padding-bottom: calc(48px + env(safe-area-inset-bottom));
    }
    .ip-title { font-size: 24px; margin-bottom: 6px; }
    .ip-sub { font-size: 13px; line-height: 1.7; margin-bottom: 18px; }

    /* 搜索框竖排：输入框整行、按钮整行（flex:none 防止 flex-basis 垂直撑高） */
    .ip-search { flex-direction: column; align-items: stretch; max-width: none; }
    .ip-search-input { flex: none; width: 100%; min-width: 0; }
    .ip-input {
        -webkit-appearance: none;
        appearance: none;
        font-size: 16px;
    }
    .ip-btn { width: 100%; min-height: 44px; }

    .ip-recent { font-size: 13px; }
    .ip-chip { min-height: 34px; display: inline-flex; align-items: center; }

    .ip-panel, .ip-card { padding: 14px; border-radius: 12px; }
    .ip-mine { padding: 18px 14px; }
    .ip-mine-ip { font-size: 26px; }
    .ip-mine-loc { font-size: 14px; }

    .ip-grid { grid-template-columns: 1fr; gap: 12px; }
    .ip-card-wide { grid-column: auto; }

    .ip-row { font-size: 13px; }
    .ip-k { flex: 0 0 80px; }

    .ip-dns-table { display: block; overflow-x: auto; white-space: nowrap; }
    .ip-addr { font-size: 14px; }
    .ip-btn-copy { margin-left: 0; }
}
