/* ==========================================================================
   tools.css — 网络工具共享组件样式（科幻风）
   类别：组件（协议选项卡、状态徽标、历史记录、数据表格）
   Online Test / Hawkeye 共用；布局见 search.css
   ========================================================================== */

/* ---------- 协议选项卡（搜索框内左侧） ---------- */
.proto-tabs {
    display: flex;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 3px;
    flex-shrink: 0;
}

.proto-tab {
    padding: 6px 14px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.proto-tab.active {
    background: rgba(34, 211, 238, 0.15);
    color: #a5f3fc;
    box-shadow: inset 0 0 10px rgba(34, 211, 238, 0.12);
}

/* ---------- 结果容器 ---------- */
.tool-result { width: 100%; }

.result-summary {
    display: inline-block;
    padding: 8px 18px;
    border-radius: var(--radius-pill);
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 14px;
}

/* ---------- 状态徽标 ---------- */
.st {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 12px;
    border-radius: var(--radius-pill);
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}

.st-online        { color: var(--green); background: rgba(52, 211, 153, 0.12); }
.st-offline       { color: var(--red);   background: rgba(248, 113, 113, 0.12); }
.st-local-online  { color: var(--orange); background: rgba(251, 191, 36, 0.12); }
.st-local-offline { color: var(--red);   background: rgba(248, 113, 113, 0.12); }
.st-loopback      { color: var(--blue);  background: rgba(96, 165, 250, 0.12); }

/* ---------- 数据表格 ---------- */
.tool-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

table.tool-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.tool-table thead th {
    text-align: left;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid var(--border);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-dim);
    letter-spacing: 0.03em;
}

/* 表头图标：表头内容配图标，单元格文本仍左对齐 */
.tool-table th .th-inner {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.tool-table th iconify-icon { font-size: 14px; color: var(--accent); }

.tool-table tbody td {
    padding: 11px 16px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
    word-break: break-all;
}

.tool-table tbody tr:last-child td { border-bottom: none; }

.tool-table tbody tr:hover td { background: rgba(34, 211, 238, 0.03); }

.tool-table .mono {
    font-family: var(--mono);
    font-size: 0.85rem;
}

/* 字段列（键名）：固定列宽，避免被右侧内容挤占换行 */
.tool-table .k {
    width: 180px;
    min-width: 180px;
    max-width: 180px;
    white-space: nowrap;
    color: var(--text-dim);
}

/* 字段单元格（键名 + 图标） */
.tool-table .field-cell {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tool-table .field-cell iconify-icon { font-size: 14px; color: var(--accent); }

.tool-table .ns-item {
    display: inline-block;
    margin: 2px 6px 2px 0;
    padding: 2px 10px;
    background: rgba(34, 211, 238, 0.1);
    color: var(--accent);
    border-radius: var(--radius-pill);
    font-size: 0.78rem;
}

/* ---------- 历史记录（查询列表） ---------- */
.history-wrap {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.history-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.history-list {
    list-style: none;
    max-height: 224px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-right: 4px;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 9px;
    font-size: 0.84rem;
}

.history-proto {
    flex-shrink: 0;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--blue);
    opacity: 0.9;
}

.history-host {
    flex: 1;
    min-width: 0;
    word-break: break-all;
    font-family: var(--mono);
    font-size: 0.8rem;
    cursor: pointer;
}

.history-host:hover { color: var(--accent); }

.history-status { flex-shrink: 0; }

.history-time {
    flex-shrink: 0;
    font-size: 0.72rem;
    color: var(--text-secondary);
}

.history-del {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-dim);
    font-size: 1rem;
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.15s, color 0.15s;
}

.history-del:hover {
    background: rgba(248, 113, 113, 0.12);
    color: var(--red);
}

.history-empty {
    font-size: 0.8rem;
    color: var(--text-secondary);
    padding: 8px 0;
}

.history-loading {
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding: 8px 0;
}

/* ---------- 提示消息 ---------- */
.wild-loading {
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding: 8px 0;
}

.whois-empty {
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding: 8px 0;
}

/* ---------- 在线详情卡（解析 IP / 归属地 / 站点名 / SEO / 图标） ---------- */
.ot-details {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
}

.site-detail {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.site-detail-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(34, 211, 238, 0.1);
    color: var(--accent);
    font-size: 1.2rem;
    overflow: hidden;
}

.site-detail-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.site-detail-body { flex: 1; min-width: 0; }

.site-detail-title {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 0.95rem;
    font-weight: 600;
}

.site-detail-name { color: var(--text); }

.site-detail-target {
    font-size: 0.78rem;
    color: var(--text-dim);
    font-weight: 400;
}

.site-detail-desc {
    margin-top: 3px;
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.site-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    margin-top: 9px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.site-detail-meta .m b {
    color: var(--text);
    font-weight: 600;
    margin-right: 4px;
}

.site-detail-meta .m .mono {
    font-family: var(--mono);
    color: var(--accent);
}

.badge-cf {
    display: inline-block;
    padding: 2px 10px;
    border-radius: var(--radius-pill);
    background: rgba(251, 191, 36, 0.15);
    color: var(--orange);
    font-size: 0.75rem;
    font-weight: 600;
}
