@charset "utf-8";
/* ============================================================
   端口扫描工具 · 公共样式
   兼容说明：不使用 flex gap / CSS 变量 / clamp / inset / mask / backdrop-filter
   ============================================================ */

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
    margin: 0;
    min-height: 100%;
    padding: 28px 12px 0;
    background-color: #f3f6fc;
    background-image:
        radial-gradient(circle at 10% 0%, rgba(74, 71, 236, 0.16), rgba(74, 71, 236, 0) 42%),
        radial-gradient(circle at 92% 2%, rgba(15, 134, 218, 0.14), rgba(15, 134, 218, 0) 40%);
    background-repeat: no-repeat;
    background-attachment: fixed;
    color: #1b2233;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-flex-direction: column;
    flex-direction: column;
}

/* ---------- 页面容器 ---------- */
.page {
    width: 100%;
    max-width: 650px;
    margin: 0 auto;
    -webkit-flex: 1 0 auto;
    flex: 1 0 auto;
}

/* ---------- 顶部标题 ---------- */
.site-header { text-align: center; margin-bottom: 18px; }

.site-header h1 {
    margin: 0;
    font-size: 26px;
    line-height: 1.3;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #1b2233;
}

.site-header p {
    margin: 6px 0 0;
    font-size: 13px;
    color: #7b869c;
}

/* ---------- 卡片 ---------- */
.card {
    background: #ffffff;
    border: 1px solid #e6ebf5;
    border-radius: 18px;
    box-shadow: 0 16px 40px -22px rgba(35, 53, 110, 0.4), 0 3px 10px -6px rgba(35, 53, 110, 0.1);
    padding: 20px;
}

.card + .card { margin-top: 14px; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 16px; }

.field label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 7px;
}

.input-wrap { position: relative; }

.input-wrap .ico {
    position: absolute;
    left: 13px;
    top: 50%;
    width: 17px;
    height: 17px;
    margin-top: -8px;
    color: #9aa5bb;
}

input[type="text"] {
    width: 100%;
    padding: 13px 13px 13px 40px;
    font-size: 15px;
    font-family: inherit;
    color: #1b2233;
    background: #f8fafd;
    border: 1px solid #e6ebf5;
    border-radius: 12px;
    outline: none;
    -webkit-transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
    transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
    -webkit-appearance: none;
    border-radius: 12px;
}

input[type="text"]::-webkit-input-placeholder { color: #a9b3c6; }
input[type="text"]:-ms-input-placeholder { color: #a9b3c6; }
input[type="text"]::placeholder { color: #a9b3c6; }

input[type="text"]:focus {
    background: #ffffff;
    border-color: #8b8af5;
    box-shadow: 0 0 0 3px rgba(74, 71, 236, 0.12);
}

/* ---------- 快捷端口 ---------- */
.chips { margin: 9px -8px 0 0; font-size: 0; }

.chip {
    display: inline-block;
    margin: 0 8px 8px 0;
    padding: 5px 11px;
    font-size: 12px;
    font-family: inherit;
    font-weight: 600;
    color: #4a5568;
    background: #f8fafd;
    border: 1px solid #e6ebf5;
    border-radius: 20px;
    cursor: pointer;
    -webkit-transition: all 0.16s;
    transition: all 0.16s;
}

.chip:hover {
    color: #4a47ec;
    border-color: #c9c8fb;
    background: #f4f4ff;
}

/* ---------- 按钮 ---------- */
.btn {
    display: inline-block;
    padding: 11px 16px;
    font-size: 14px;
    font-family: inherit;
    font-weight: 600;
    line-height: 1.4;
    text-align: center;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    -webkit-transition: all 0.18s;
    transition: all 0.18s;
    white-space: nowrap;
}

.btn:active { opacity: 0.88; }

.btn-primary {
    display: block;
    width: 100%;
    padding: 13px 16px;
    color: #ffffff;
    background: #4a47ec;
    background-image: -webkit-linear-gradient(left, #4a47ec 0%, #2f6ae0 55%, #0f86da 100%);
    background-image: linear-gradient(90deg, #4a47ec 0%, #2f6ae0 55%, #0f86da 100%);
    border: none;
    box-shadow: 0 12px 22px -14px rgba(74, 71, 236, 0.9);
}

.btn-primary:hover { box-shadow: 0 14px 26px -14px rgba(74, 71, 236, 1); }

.btn-primary[disabled] {
    opacity: 0.75;
    cursor: default;
    box-shadow: none;
}

.btn-ghost {
    color: #4a5568;
    background: #ffffff;
    border-color: #e6ebf5;
}

.btn-ghost:hover {
    color: #4a47ec;
    border-color: #c9c8fb;
    background: #f7f7ff;
}

.btn-danger {
    color: #c93a3f;
    background: #ffffff;
    border-color: #f2d3d4;
}

.btn-danger:hover { background: #fdf5f5; }

.btn-danger-solid {
    color: #ffffff;
    background: #d84348;
    border-color: #d84348;
}

.btn-danger-solid:hover { background: #c93a3f; }

/* 加载动画 */
.spinner {
    display: none;
    width: 14px;
    height: 14px;
    margin-right: 7px;
    vertical-align: -2px;
    border: 2px solid rgba(255, 255, 255, 0.45);
    border-top-color: #ffffff;
    border-radius: 50%;
    -webkit-animation: spin 0.7s linear infinite;
    animation: spin 0.7s linear infinite;
}

.btn-primary.loading .spinner { display: inline-block; }

@-webkit-keyframes spin { to { -webkit-transform: rotate(360deg); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 提示 ---------- */
.hint {
    margin: 12px 0 0;
    font-size: 12px;
    line-height: 1.7;
    color: #7b869c;
    text-align: center;
}

.hint b { color: #4a5568; font-weight: 600; }

.error {
    display: none;
    margin-bottom: 14px;
    padding: 9px 12px;
    font-size: 13px;
    color: #d84348;
    background: #fef3f3;
    border: 1px solid #f8dcdc;
    border-radius: 10px;
}

.error.show { display: block; }

/* ---------- 查询结果 ---------- */
.result-card { padding: 0; overflow: hidden; }

.result-head {
    padding: 16px 18px;
    border-bottom: 1px solid #eef2f9;
}

.result-head h2 {
    display: inline-block;
    margin: 0;
    font-size: 15.5px;
    font-weight: 700;
    vertical-align: middle;
}

.result-head .pill {
    float: right;
    max-width: 62%;
    margin-top: 1px;
    padding: 3px 10px;
    font-size: 16px;
    font-weight: 600;
    color: #4a47ec;
    background: #f1f1ff;
    border: 1px solid #deddfb;
    border-radius: 20px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.summary {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-flex-wrap: wrap;
    flex-wrap: wrap;
    border-bottom: 1px solid #eef2f9;
}

.summary .item {
    width: 50%;
    padding: 11px 16px;
    border-right: 1px solid #eef2f9;
    border-bottom: 1px solid #eef2f9;
}

.summary .item.right { border-right: none; }
.summary .item.bottom { border-bottom: none; }

.summary .k {
    display: block;
    font-size: 11.5px;
    color: #7b869c;
    margin-bottom: 2px;
}

.summary .v {
    display: block;
    font-size: 13.5px;
    font-weight: 700;
    color: #1b2233;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.summary .v.ok { color: #0aa06e; }

/* ---------- 表格（通用） ---------- */
.table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

th {
    text-align: left;
    font-size: 11.5px;
    font-weight: 600;
    color: #7b869c;
    background: #fafcff;
    padding: 9px 16px;
    border-bottom: 1px solid #eef2f9;
    white-space: nowrap;
}

td {
    padding: 11px 16px;
    border-bottom: 1px solid #eef2f9;
    color: #4a5568;
    vertical-align: middle;
}

tr:last-child td { border-bottom: none; }

tbody tr:hover td { background: #fafcff; }

/* 首页结果表 */
.port-table th:nth-child(1), .port-table td:nth-child(1) { width: 90px; }
.port-table th:nth-child(2), .port-table td:nth-child(2) { width: 110px; }

td.port {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-weight: 700;
    color: #1b2233;
}

td.service { color: #7b869c; font-size: 12.5px; }

/* 状态徽章 */
.status {
    display: inline-block;
    padding: 2px 9px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 20px;
    white-space: nowrap;
}

.status i {
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-right: 5px;
    vertical-align: 1px;
    border-radius: 50%;
    background: currentColor;
}

.status.open { color: #0aa06e; background: #e7f8f0; }
.status.closed { color: #7b869c; background: #f1f4f9; }

/* 结果操作按钮 */
.result-actions {
    padding: 12px 16px 16px;
    border-top: 1px solid #eef2f9;
    background: #fcfdff;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-flex-wrap: wrap;
    flex-wrap: wrap;
    -webkit-box-pack: justify;
    -webkit-justify-content: space-between;
    justify-content: space-between;
}

.result-actions .btn {
    width: 48%;
    margin-bottom: 8px;
    padding: 10px 8px;
    font-size: 13px;
}

/* ---------- 底部操作按钮 ---------- */
.page-actions {
    margin-top: 14px;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-flex-wrap: wrap;
    flex-wrap: wrap;
    -webkit-box-pack: justify;
    -webkit-justify-content: space-between;
    justify-content: space-between;
}

.page-actions .btn { width: 48%; margin-bottom: 8px; }

.page-actions.three .btn {
    width: 31.5%;
    padding-left: 6px;
    padding-right: 6px;
    font-size: 12.5px;
}

/* ---------- 统计卡 ---------- */
.stats {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-flex-wrap: wrap;
    flex-wrap: wrap;
    margin-bottom: 14px;
    background: #ffffff;
    border: 1px solid #e6ebf5;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 12px 30px -24px rgba(35, 53, 110, 0.5);
}

.stat {
    width: 50%;
    margin: 0;
    padding: 13px 16px;
    border-right: 1px solid #eef2f9;
    border-bottom: 1px solid #eef2f9;
}

.stat.right { border-right: none; }
.stat.bottom { border-bottom: none; }

.stat dt {
    margin: 0 0 3px;
    font-size: 11.5px;
    font-weight: 500;
    color: #7b869c;
}

.stat dd {
    margin: 0;
    font-size: 21px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #1b2233;
}

.stat dd.blue { color: #4a47ec; }
.stat dd.green { color: #0aa06e; }

/* ---------- 工具栏 ---------- */
.toolbar {
    padding: 13px 16px;
    border-bottom: 1px solid #eef2f9;
    background: #fcfdff;
}

.toolbar .search { position: relative; margin-bottom: 9px; }

.toolbar .search .ico {
    position: absolute;
    left: 11px;
    top: 50%;
    width: 15px;
    height: 15px;
    margin-top: -8px;
    color: #9aa5bb;
}

.toolbar .search input {
    padding: 10px 11px 10px 33px;
    font-size: 13.5px;
    background: #ffffff;
    border-radius: 10px;
}

.toolbar-row {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-flex-wrap: wrap;
    flex-wrap: wrap;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    margin-right: -8px;
}

.toolbar-row select,
.toolbar-row .btn,
.toolbar-row .reset {
    margin: 0 8px 8px 0;
}

select {
    -webkit-flex: 1 1 auto;
    flex: 1 1 auto;
    min-width: 104px;
    padding: 9px 10px;
    font-size: 13px;
    font-family: inherit;
    color: #4a5568;
    background: #ffffff;
    border: 1px solid #e6ebf5;
    border-radius: 10px;
    outline: none;
    cursor: pointer;
}

select:focus { border-color: #8b8af5; }

.toolbar-row .btn { padding: 9px 16px; font-size: 13px; border-radius: 10px; }

.toolbar-row .btn-primary {
    display: inline-block;
    width: auto;
    box-shadow: none;
}

.toolbar-row .reset {
    padding: 9px 12px;
    font-size: 13px;
    font-weight: 600;
    color: #7b869c;
    text-decoration: none;
    border: 1px solid #e6ebf5;
    border-radius: 10px;
    background: #ffffff;
}

.toolbar-row .reset:hover { color: #4a47ec; border-color: #c9c8fb; }

/* ---------- 列表头 ---------- */
.list-head {
    padding: 10px 16px;
    font-size: 12.5px;
    color: #7b869c;
    border-bottom: 1px solid #eef2f9;
}

.list-head b { color: #1b2233; font-weight: 700; }

.list-head .right { float: right; }

/* ---------- 历史记录表 ---------- */
.history-table { table-layout: fixed; }

.history-table th, .history-table td { padding: 10px 12px; }

.history-table th:nth-child(2), .history-table td:nth-child(2) { width: 54px; }
.history-table th:nth-child(3), .history-table td:nth-child(3) { width: 74px; }
.history-table th:nth-child(4), .history-table td:nth-child(4) { width: 108px; }

td.target {
    font-weight: 600;
    color: #1b2233;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

td.target a {
    color: #1b2233;
    text-decoration: none;
}

td.target a:hover { color: #4a47ec; }

td.time {
    font-size: 11.5px;
    color: #7b869c;
    line-height: 1.45;
}

td.time .t { display: block; }

.empty { padding: 46px 18px; text-align: center; color: #7b869c; }
.empty strong { display: block; margin-bottom: 6px; font-size: 14px; color: #4a5568; }
.empty span { font-size: 12.5px; }

/* ---------- 分页 ---------- */
.pager {
    padding: 11px 16px;
    border-top: 1px solid #eef2f9;
    background: #fcfdff;
    font-size: 0;
}

.pager a, .pager span.pg {
    display: inline-block;
    min-width: 30px;
    height: 30px;
    margin: 0 6px 6px 0;
    padding: 0 9px;
    font-size: 12.5px;
    font-weight: 600;
    line-height: 28px;
    text-align: center;
    text-decoration: none;
    color: #4a5568;
    background: #ffffff;
    border: 1px solid #e6ebf5;
    border-radius: 9px;
}

.pager a:hover { color: #4a47ec; border-color: #c9c8fb; background: #f7f7ff; }

.pager a.active {
    color: #ffffff;
    background: #4a47ec;
    background-image: -webkit-linear-gradient(left, #4a47ec, #0f86da);
    background-image: linear-gradient(90deg, #4a47ec, #0f86da);
    border-color: #4a47ec;
}

.pager .dots {
    display: inline-block;
    margin: 0 4px 6px 0;
    font-size: 12.5px;
    color: #a9b3c6;
}

/* ---------- 删除页 ---------- */
.del-wrap {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    -webkit-flex: 1 0 auto;
    flex: 1 0 auto;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
}

.del-wrap .card { width: 100%; }

.del-note {
    margin: 16px 0 0;
    padding: 11px 13px;
    font-size: 12px;
    color: #7b869c;
    text-align: center;
    background: #f8fafd;
    border: 1px solid #eef2f9;
    border-radius: 10px;
}

.del-note b { color: #4a5568; }

.del-links { margin-top: 12px; }

.del-links .btn {
    display: block;
    width: 100%;
    margin-bottom: 8px;
    padding: 10px;
    font-size: 13px;
}

/* 弹窗 */
.popup {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 999;
    padding: 20px;
    background: rgba(20, 28, 48, 0.45);
    text-align: center;
    white-space: nowrap;
}

.popup:before {
    content: "";
    display: inline-block;
    height: 100%;
    vertical-align: middle;
}

.popup.show { display: block; }

.popup-box {
    display: inline-block;
    width: 100%;
    max-width: 330px;
    padding: 24px 20px;
    text-align: center;
    white-space: normal;
    vertical-align: middle;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 24px 60px -20px rgba(20, 28, 48, 0.5);
}

.popup-box h3 { margin: 0 0 8px; font-size: 16px; font-weight: 700; }

.popup-box p {
    margin: 0 0 16px;
    font-size: 13px;
    line-height: 1.7;
    color: #4a5568;
    word-break: break-all;
}

.popup-actions { font-size: 0; }

.popup-actions .btn {
    display: inline-block;
    width: 48%;
    padding: 10px 8px;
    font-size: 13px;
}

.popup-actions .btn + .btn { margin-left: 4%; }

/* ---------- 底部版权 ---------- */
.site-footer {
    width: 100%;
    -webkit-flex: 0 0 auto;
    flex: 0 0 auto;
    padding: 18px 12px 14px;
    margin-top: auto;
}

.foot-inner {
    max-width: 500px;
    margin: 0 auto;
    padding-top: 12px;
    border-top: 1px solid #e2e8f4;
    font-size: 12px;
    color: #93a0b5;
    text-align: center;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-flex-wrap: wrap;
    flex-wrap: wrap;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    -webkit-box-pack: justify;
    -webkit-justify-content: space-between;
    justify-content: space-between;
}

.foot-inner .copyright { padding-right: 10px; }

.foot-inner a {
    color: #6b7a94;
    text-decoration: none;
}

.foot-inner a:hover { color: #4a47ec; }

.foot-inner .usage { white-space: nowrap; }

.foot-inner .usage b {
    color: #4a47ec;
    font-weight: 700;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ---------- 窄屏 ---------- */
@media screen and (max-width: 420px) {
    body { padding: 20px 10px 0; }
    .card { padding: 16px; border-radius: 16px; }
    .site-header h1 { font-size: 23px; }
    .stat dd { font-size: 19px; }
    .history-table th, .history-table td { padding: 9px 8px; }
    .history-table th:nth-child(3), .history-table td:nth-child(3) { width: 66px; }
    .history-table th:nth-child(4), .history-table td:nth-child(4) { width: 96px; }
    .foot-inner { display: block; text-align: center; }
    .foot-inner .copyright { display: block; padding-right: 0; margin-bottom: 4px; }
}
