/* =============================================================
 * IP 归属地查询 - 工具页样式
 * 【2026-11-02】
 *
 * 注意：全站共享的 life-calc.css 里有
 *   #app * { margin:0; padding:0; box-sizing:border-box }
 * 这条选择器特异性是 (1,0,0)，普通类 .ipl-xxx 是 (0,1,0)，会被它压过去，
 * 导致自定义 padding 全部失效。所以本文件所有规则一律以 #app 开头。
 * ============================================================= */

/* ---------- 你的 IP ---------- */
#app .ipl-self {
    background: linear-gradient(135deg, #ffffff 0%, #f5f8ff 100%);
    border-color: #dbe6ff;
}
#app .ipl-self-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
#app .ipl-self-ip {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--primary);
    word-break: break-all;
    line-height: 1.3;
}
#app .ipl-self-copy {
    padding: 6px 14px;
    font-size: 13px;
    flex: none;
}
#app .ipl-self-region {
    margin-top: 6px;
    font-size: 14px;
    color: var(--text);
    line-height: 1.7;
    min-height: 24px;
}
#app .ipl-self-region .ipl-dim {
    color: var(--text-secondary);
}
#app .ipl-self-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 2px;
}
#app .ipl-self .hint { margin-top: 10px; }

/* ---------- 输入区 ---------- */
#app .ipl-input {
    width: 100%;
    display: block;
    padding: 12px 14px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 14px;
    line-height: 1.8;
    color: var(--text);
    background: #fbfcfe;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    resize: vertical;
    min-height: 104px;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}
#app .ipl-input:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px var(--primary-light);
}
#app .ipl-input::placeholder { color: #a3adbd; }

#app .ipl-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
}
#app .ipl-bar-bottom { margin-top: 14px; }
#app .ipl-count {
    font-size: 12px;
    color: var(--text-secondary);
    margin-left: auto;
}
#app .ipl-count.ipl-over { color: var(--danger); font-weight: 600; }

/* 示例小标签 */
#app .ipl-samples {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px dashed var(--border);
}
#app .ipl-samples-t {
    font-size: 12.5px;
    color: var(--text-secondary);
}
#app .ipl-chip {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12.5px;
    padding: 5px 12px;
    border-radius: 999px;
    border: 1px solid #dbe6ff;
    background: #f2f6ff;
    color: var(--primary);
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition), transform var(--transition);
}
#app .ipl-chip:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    transform: translateY(-1px);
}

/* ---------- 结果表 ---------- */
#app .ipl-summary {
    font-size: 12.5px;
    font-weight: 400;
    color: var(--text-secondary);
    margin-left: 8px;
}
#app .ipl-table-wrap {
    margin-top: 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}
#app .ipl-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}
#app .ipl-table thead th {
    text-align: left;
    padding: 10px 14px;
    background: #f7f9fc;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 12.5px;
    white-space: nowrap;
    border-bottom: 1px solid var(--border);
}
#app .ipl-table tbody td {
    padding: 11px 14px;
    border-bottom: 1px solid #f1f3f7;
    color: var(--text);
    vertical-align: middle;
    line-height: 1.6;
}
#app .ipl-table tbody tr:last-child td { border-bottom: 0; }
#app .ipl-table tbody tr:hover td { background: #fafbff; }
#app .ipl-table .ipl-ip {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
    color: #0f172a;
    word-break: break-all;
}
#app .ipl-table .ipl-region { font-weight: 600; }
#app .ipl-table .ipl-isp { color: var(--text-secondary); }
#app .ipl-table .ipl-err {
    color: var(--danger);
    font-size: 13px;
}

/* 类型徽标 */
#app .ipl-badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid transparent;
}
#app .ipl-badge-normal { background: #eef2f7; color: #475569; }
#app .ipl-badge-dc     { background: #fff7ed; color: #b45309; border-color: #fed7aa; }
#app .ipl-badge-private{ background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
#app .ipl-badge-err    { background: var(--danger-bg); color: var(--danger); border-color: #fecaca; }
#app .ipl-badge-self   { background: var(--success-bg); color: #047857; border-color: #a7f3d0; }

/* ---------- 说明 ---------- */
#app .ipl-note-list {
    list-style: none;
    margin-top: 4px;
}
#app .ipl-note-list li {
    position: relative;
    padding-left: 18px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.9;
    margin-top: 8px;
}
#app .ipl-note-list li::before {
    content: "";
    position: absolute;
    left: 4px;
    top: 12px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #c7d2e4;
}
#app .ipl-note-list b { color: var(--text); font-weight: 600; }
#app .ipl-note-list code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    background: #f1f5f9;
    padding: 1px 5px;
    border-radius: 4px;
    color: #334155;
}

/* ---------- 轻提示 ---------- */
#app .ipl-toast {
    position: fixed;
    left: 50%;
    bottom: 40px;
    transform: translateX(-50%) translateY(10px);
    background: rgba(15, 23, 42, 0.92);
    color: #fff;
    font-size: 13px;
    padding: 10px 18px;
    border-radius: 10px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease, transform 0.22s ease;
    z-index: 9999;
}
#app .ipl-toast.ipl-show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ---------- 移动端：表格转卡片 ---------- */
@media (max-width: 640px) {
    #app .ipl-self-ip { font-size: 21px; }
    #app .ipl-count { margin-left: 0; width: 100%; }
    #app .ipl-table thead { display: none; }
    #app .ipl-table,
    #app .ipl-table tbody,
    #app .ipl-table tr,
    #app .ipl-table td { display: block; width: 100%; }
    #app .ipl-table tr {
        padding: 10px 12px;
        border-bottom: 1px solid #f1f3f7;
    }
    #app .ipl-table tbody tr:last-child { border-bottom: 0; }
    #app .ipl-table tbody td {
        padding: 3px 0;
        border: 0;
        display: flex;
        align-items: baseline;
        gap: 10px;
    }
    #app .ipl-table tbody td::before {
        content: attr(data-label);
        flex: none;
        width: 62px;
        font-size: 12px;
        color: var(--text-secondary);
    }
    #app .ipl-table tbody tr:hover td { background: transparent; }
}
