* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: "Microsoft YaHei", "微软雅黑", "PingFang SC", Arial, sans-serif;
    font-size: 14px;
    color: #1f2328;
    background: #f4f5f7;
}

/* ===== 登录页 ===== */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}
.login-card {
    width: 360px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 32px 28px 26px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, .06);
}
.login-card h1 {
    margin: 0 0 22px;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    letter-spacing: 1px;
}

/* ===== 通用表单 ===== */
.field { display: block; margin-bottom: 14px; }
.field > span {
    display: block;
    margin-bottom: 6px;
    color: #57606a;
    font-size: 13px;
}
.field > span i { color: #d92d20; font-style: normal; margin-left: 2px; }
.field input[type=text],
.field input[type=password],
.field input[type=number],
.field select,
.field input:not([type]) {
    width: 100%;
    height: 36px;
    padding: 0 10px;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    outline: none;
}
.field input:focus, .field select:focus { border-color: #2f6feb; box-shadow: 0 0 0 3px rgba(47,111,235,.12); }
.field.check { display: flex; align-items: center; margin-bottom: 10px; }
.field.check > span { margin: 0; color: #1f2328; font-size: 13px; }
.field.check input { width: 16px; height: 16px; margin-left: 8px; }

.row2 { display: flex; gap: 14px; }
.row2 .field { flex: 1; }
.row2.checks { gap: 18px; }

/* ===== 按钮 ===== */
.btn {
    height: 34px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    background: #fff;
    line-height: 1;
}
.btn:disabled { opacity: .55; cursor: default; }
.btn-primary { background: #2f6feb; border-color: #2f6feb; color: #fff; }
.btn-primary:hover:not(:disabled) { background: #2560d4; }
.btn-ghost { border-color: #d0d7de; color: #1f2328; }
.btn-ghost:hover:not(:disabled) { background: #f2f4f7; }
.btn-block { width: 100%; height: 38px; margin-top: 6px; }
.btn-mini {
    height: 26px;
    padding: 0 10px;
    margin-right: 6px;
    font-size: 13px;
    border: 1px solid #d0d7de;
    border-radius: 5px;
    background: #fff;
    cursor: pointer;
}
.btn-mini:hover:not(:disabled) { background: #f2f4f7; }
.btn-danger { color: #d92d20; border-color: #f0b6b0; }
.btn-danger:hover:not(:disabled) { background: #fdf2f1; }

/* ===== 顶部栏 / 主体 ===== */
.topbar {
    height: 52px;
    display: flex;
    align-items: center;
    padding: 0 22px;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
}
.brand { font-size: 15px; font-weight: 600; letter-spacing: .5px; }
.spacer { flex: 1; }
.who { color: #57606a; margin-right: 12px; font-size: 13px; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 20px 22px 60px; }
.toolbar { display: flex; align-items: center; margin-bottom: 14px; }
.meta { color: #8a9199; font-size: 13px; }

.card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}
table.rules { width: 100%; border-collapse: collapse; }
table.rules th, table.rules td {
    padding: 11px 14px;
    text-align: left;
    border-bottom: 1px solid #eef0f2;
    vertical-align: middle;
}
table.rules th {
    background: #fafbfc;
    font-weight: 600;
    color: #57606a;
    font-size: 13px;
}
table.rules tr:last-child td { border-bottom: none; }
.mono { font-family: Consolas, "Courier New", monospace; font-size: 13px; word-break: break-all; }
.note { color: #57606a; }
.empty { padding: 46px 0; text-align: center; color: #8a9199; }

.tag {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 4px;
    font-size: 12px;
    margin-right: 6px;
}
.tag-host { background: #eaf1fe; color: #2f6feb; }
.tag-path { background: #fdf0e6; color: #b25a12; }
.dot {
    display: inline-block;
    width: 7px; height: 7px;
    border-radius: 50%;
    margin-right: 6px;
}
.dot.on { background: #17a34a; }
.dot.off { background: #c4c9cf; }

/* ===== 面板 ===== */
.panel-mask {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, .28);
    z-index: 40;
}
.panel {
    position: fixed;
    top: 0; right: 0;
    width: 460px;
    max-width: 100%;
    height: 100%;
    background: #fff;
    z-index: 41;
    padding: 22px 24px 80px;
    overflow-y: auto;
    box-shadow: -6px 0 24px rgba(0, 0, 0, .10);
}
.panel h2 { margin: 0 0 20px; font-size: 16px; font-weight: 600; }
.panel-actions {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    padding: 14px 24px;
    background: #fff;
    border-top: 1px solid #eef0f2;
    text-align: right;
}
.panel-actions .btn { margin-left: 10px; }

/* ===== 轻提示 ===== */
.toast {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(.96);
    background: rgba(0, 0, 0, .86);
    color: #fff;
    padding: 11px 20px;
    border-radius: 6px;
    font-size: 14px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .16s, transform .16s;
    z-index: 90;
    max-width: 70%;
    text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
