/* ================================================================
   菜刀客在线工具页 · port-scanner.html 私有样式
   需在 /css/common.css 之后加载。
   ================================================================ */

/* ---- 说明横幅 ---- */
.scan-note {
    background: #fefce8;
    border: 1px solid #fde68a;
    color: #854d0e;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 12px;
    line-height: 1.7;
    margin-bottom: 15px;
}

.scan-note b {
    color: #713f12;
}

.scan-note code {
    background: #fef3c7;
    border-radius: 4px;
    padding: 0 4px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}

/* ---- 目标地址快捷芯片 ---- */
.qchips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.qchip {
    padding: 3px 10px;
    font-size: 12px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    color: #374151;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.2s;
}

.qchip:hover {
    border-color: #667eea;
    color: #4338ca;
    background: #eef2ff;
}

/* ---- 预设端口组 ---- */
.port-groups {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.port-group {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: #374151;
    user-select: none;
    transition: all 0.2s;
}

.port-group:hover {
    border-color: #667eea;
}

.port-group.active {
    border-color: #667eea;
    background: #eef2ff;
    color: #4338ca;
}

.port-group input {
    accent-color: #667eea;
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.port-group .cnt {
    margin-left: auto;
    font-size: 11px;
    color: #9ca3af;
    font-variant-numeric: tabular-nums;
}

/* ---- 自定义端口输入行 ---- */
.port-add-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.port-add-row .form-control {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
}

.port-add-row .btn {
    flex-shrink: 0;
    white-space: nowrap;
}

/* ---- 已选端口芯片 ---- */
.port-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-height: 132px;
    overflow: auto;
    padding: 8px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
}

.port-chips:empty::before {
    content: '尚未选择端口，请在左侧勾选预设组或手动添加';
    font-size: 12px;
    color: #9ca3af;
}

.port-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    color: #4338ca;
    font-size: 12px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-variant-numeric: tabular-nums;
}

.port-chip.custom {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #047857;
}

.port-chip .x {
    cursor: pointer;
    font-size: 13px;
    line-height: 1;
    color: #6366f1;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.port-chip.custom .x {
    color: #059669;
}

.port-chip .x:hover {
    color: #dc2626;
}

/* ---- 扫描参数 ---- */
.param-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.param-row .form-control {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}

/* ---- 进度条 ---- */
.scan-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.scan-progress .bar {
    flex: 1;
    height: 8px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
}

.scan-progress .fill {
    height: 100%;
    width: 0;
    border-radius: 999px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.2s ease;
}

.scan-progress .txt {
    font-size: 12px;
    color: #6b7280;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* ---- 状态标记 ---- */
.st {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.st-open {
    background: #dcfce7;
    color: #16a34a;
}

.st-closed {
    background: #f3f4f6;
    color: #6b7280;
}

.st-timeout {
    background: #fef3c7;
    color: #d97706;
}

.st-wait {
    background: #eef2ff;
    color: #4338ca;
}

/* ---- 扫描结果表格 ---- */
table.scan-table th:first-child,
table.scan-table td:first-child {
    text-align: left;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-weight: 600;
    color: #374151;
}

table.scan-table td.col-svc {
    text-align: left;
    color: #6b7280;
}

table.scan-table td.col-ms {
    text-align: right;
}

table.scan-table tr.row-open td {
    background: #f0fdf4;
}

table.scan-table tr.row-open td:first-child {
    color: #16a34a;
}

table.scan-table tr.row-hidden {
    display: none;
}

/* ---- 结果区顶部工具行 ---- */
.result-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.filter-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #374151;
    cursor: pointer;
    user-select: none;
}

.filter-check input {
    accent-color: #667eea;
    width: 15px;
    height: 15px;
}

/* ---- 风险提示条目 ---- */
.open-warn {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    padding: 9px 12px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #b91c1c;
    font-size: 12px;
    line-height: 1.7;
}

.open-warn .ico {
    flex-shrink: 0;
}

/* ---- 说明表格 ---- */
.seo-article table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin: 8px 0 4px;
}

.seo-article table th,
.seo-article table td {
    border: 1px solid #e5e7eb;
    padding: 7px 10px;
    text-align: left;
    color: #4b5563;
}

.seo-article table th {
    background: #f9fafb;
    font-weight: 600;
    color: #374151;
}

.seo-article table td:first-child {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* ---- 小屏适配 ---- */
@media (max-width: 600px) {
    .port-groups {
        grid-template-columns: 1fr;
    }

    .port-add-row {
        flex-direction: column;
        align-items: stretch;
    }

    .port-chips {
        max-height: 108px;
    }
}