/* ============================================================
   base.css —— 平台前台与后台管理「共用」的基础样式
   平台页面：base.css + style.css
   后台页面：base.css + admin.css
   这里只放两侧都会用到的基础件（重置、容器、按钮、表单、表格、
   Toast、Tooltip、状态文本）。业务专属样式请分别放进 style / admin。
   ============================================================ */

/* ========== Base ========== */
/* 工作区总宽：品牌栏 / 导航 / 主体 / 页脚统一取值，调整站点宽度只需改这一处 */
:root { --workspace-width: 1280px; }
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif; color: #333; background: #f5f7fa; line-height: 1.6; }
a { color: #4A90D9; text-decoration: none; }
a:hover { color: #357ABD; }
.container { max-width: var(--workspace-width); margin: 0 auto; padding: 0 20px; }

/* ========== Buttons ========== */
.btn { display: inline-block; padding: 8px 20px; border: 1px solid #d9d9d9; border-radius: 4px; background: #fff; color: #333; cursor: pointer; font-size: 14px; transition: all 0.2s; }
.btn:hover { border-color: #4A90D9; color: #4A90D9; }
.btn-primary { background: #4A90D9; border-color: #4A90D9; color: #fff; }
.btn-primary:hover { background: #357ABD; color: #fff; }
.btn-sm { padding: 4px 12px; font-size: 13px; }
.btn-lg { padding: 12px 32px; font-size: 16px; }
.btn-block { display: block; width: 100%; }
.btn.is-disabled { opacity: .5; }

/* ========== Forms ========== */
.tool-form { background: #fff; padding: 24px; border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); margin-bottom: 24px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 500; font-size: 14px; color: #666; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 10px 12px; border: 1px solid #d9d9d9; border-radius: 4px; font-size: 14px; transition: border-color 0.2s; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: #4A90D9; box-shadow: 0 0 0 2px rgba(74,144,217,0.1); }
.form-row { display: flex; gap: 16px; }
.form-row .form-group { flex: 1; }
.flex-2 { flex: 2; }
.flex-1 { flex: 1; }
.status-msg { margin-left: 12px; font-size: 13px; color: #999; }
.status-msg.is-error { color: #c25a5a; }
.status-msg.is-ok { color: #2c8f6b; }
.form-hint.is-error { color: #b8442f; }

/* ========== Tables ========== */
/* 下列取值为原 style.css 中「Tables 段 + Reference workspace 段」叠加后的最终结果，
   前后台表现与拆分前完全一致，改动请同时评估两侧。 */
.table-container { overflow-x: auto; background: #fff; margin-bottom: 10px; border: 1px solid #dce2e9; border-radius: 3px; box-shadow: 0 2px 5px rgba(31,53,75,.07); }
.result-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.result-table th { padding: 9px 10px; text-align: left; font-weight: 600; white-space: nowrap; color: #7f8a93; background: #fafbfc; border-bottom: 1px solid #e7ebee; font-size: 10px; }
.result-table td { padding: 8px 10px; color: #687782; border-bottom: 1px solid #edf0f2; }
.result-table tr:hover td { background: #fafbfc; }
.empty-row, .loading-row { color: #99a5ae; font-size: 12px; padding: 20px 0; text-align: center; }

/* ========== 探测节点运营商徽标（前台结果表与后台节点列表共用） ========== */
.probe-isp { display: inline-flex; padding: 3px 6px; border-radius: 4px; color: #fff; font-size: 12px; line-height: 1.1; }
.probe-isp-telecom { background: #8bc34a; }
.probe-isp-unicom { background: #ffb74d; }
.probe-isp-mobile { background: #12a9bd; }
.probe-isp-overseas { background: #7a838b; }

/* ========== 状态点 ========== */
.status-dot { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; display: inline-block; background: #2eb67d; box-shadow: 0 0 0 3px rgba(46,182,125,.12); }
.status-dot.is-offline { background: #a7b1ba; box-shadow: 0 0 0 3px rgba(167,177,186,.15); }

/* ===== Toast 提示（common.js 创建，前后台共用） ===== */
.toast-container { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; gap: 10px; align-items: center; pointer-events: none; }
.toast { pointer-events: auto; max-width: 420px; padding: 11px 18px; border-radius: 6px; font-size: 13px; line-height: 1.4; color: #fff; box-shadow: 0 6px 20px rgba(31,53,75,.18); opacity: 0; transform: translateY(-8px); transition: opacity .22s ease, transform .22s ease; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast-info { background: #4285ed; }
.toast-success { background: #2db486; }
.toast-warning { background: #f0a23b; }
.toast-error { background: #e0584f; }

/* ===== 自定义 Tooltip（可复制，替代原生 title；common.js 创建，前后台共用） ===== */
.custom-tooltip {
    position: fixed; z-index: 1000;
    max-width: 480px; max-height: 260px;
    padding: 8px 10px;
    border: 1px solid #cbd7df; border-radius: 4px;
    background: #1f2933; color: #dce7ed;
    box-shadow: 0 4px 12px rgba(31, 53, 75, .25);
    font: 11px/1.5 Consolas, "Courier New", monospace;
    white-space: pre-wrap; word-break: break-word;
    overflow: auto;
    user-select: text; -webkit-user-select: text;
    pointer-events: auto;
    opacity: 0; visibility: hidden;
    transition: opacity .12s ease;
}
.custom-tooltip.show { opacity: 1; visibility: visible; }

/* 触发 Tip 展示原始结果的链接（common.js 绑定，前后台共用） */
.raw-trigger { color: #3978bd; cursor: pointer; white-space: nowrap; }
.raw-trigger:hover { text-decoration: underline; }

/* ========== 通用响应式（表单在窄屏改为纵向堆叠） ========== */
@media (max-width: 768px) {
    .form-row { flex-direction: column; }
}
