* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
    background: #f4f6f9;
    color: #2c3038;
    font-size: 14px;
    line-height: 1.6;
}

a { color: #1677ff; text-decoration: none; }
a:hover { opacity: .85; }

/* ===== 布局 ===== */
.layout { display: flex; min-height: 100vh; }

.sidebar {
    width: 220px;
    background: #1f2733;
    color: #c7cdd8;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

.brand {
    padding: 20px 22px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    border-bottom: 1px solid #2c3644;
    letter-spacing: .5px;
}
.brand span { color: #07c160; }

.sidebar nav { padding: 12px 0; flex: 1; }
.sidebar nav a {
    display: block;
    padding: 11px 22px;
    color: #a8b2c1;
    font-size: 14px;
    border-left: 3px solid transparent;
}
.sidebar nav a:hover { background: #26303d; color: #fff; opacity: 1; }
.sidebar nav a.active {
    background: #26303d;
    color: #fff;
    border-left-color: #07c160;
}

.sidebar .foot { padding: 14px 22px; font-size: 12px; color: #6b7686; border-top: 1px solid #2c3644; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
    background: #fff;
    padding: 16px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e8ecf1;
}
.topbar h1 { margin: 0; font-size: 18px; font-weight: 600; }
.topbar .user { font-size: 13px; color: #7a8494; }

.content { padding: 24px 28px 48px; }

/* ===== 卡片 ===== */
.card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(20, 30, 50, .06);
    padding: 22px 24px;
    margin-bottom: 20px;
}
.card h2 { margin: 0 0 16px; font-size: 15px; font-weight: 600; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat {
    background: #fff;
    border-radius: 10px;
    padding: 20px 22px;
    box-shadow: 0 1px 3px rgba(20, 30, 50, .06);
}
.stat .label { font-size: 13px; color: #8b95a5; }
.stat .value { font-size: 26px; font-weight: 700; margin-top: 6px; color: #1f2733; }
.stat .value.green { color: #07c160; }

/* ===== 表格 ===== */
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { padding: 11px 12px; text-align: left; border-bottom: 1px solid #eef1f5; vertical-align: middle; }
th { background: #fafbfc; color: #6b7686; font-weight: 500; white-space: nowrap; }
tr:hover td { background: #fafbfc; }
td.mono, .mono { font-family: Consolas, Monaco, "Courier New", monospace; font-size: 12.5px; }

.avatar { width: 30px; height: 30px; border-radius: 50%; vertical-align: middle; background: #eee; }

/* ===== 按钮 ===== */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 6px;
    border: 1px solid #d6dbe3;
    background: #fff;
    color: #2c3038;
    font-size: 13.5px;
    cursor: pointer;
    transition: .15s;
}
.btn:hover { border-color: #1677ff; color: #1677ff; opacity: 1; }
.btn-primary { background: #1677ff; border-color: #1677ff; color: #fff; }
.btn-primary:hover { background: #0f66e0; color: #fff; }
.btn-green { background: #07c160; border-color: #07c160; color: #fff; }
.btn-green:hover { background: #06ad56; color: #fff; }
.btn-danger { color: #e64340; }
.btn-danger:hover { border-color: #e64340; color: #e64340; }
.btn-sm { padding: 4px 10px; font-size: 12.5px; }

/* ===== 表单 ===== */
.form-row { margin-bottom: 18px; }
.form-row label { display: block; margin-bottom: 6px; font-size: 13.5px; color: #4a5568; }
.form-row label .req { color: #e64340; }
.form-row .hint { font-size: 12.5px; color: #98a2b3; margin-top: 6px; line-height: 1.7; }
.input, select, textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #d6dbe3;
    border-radius: 6px;
    font-size: 13.5px;
    font-family: inherit;
    outline: none;
    background: #fff;
    color: #2c3038;
}
.input:focus, select:focus, textarea:focus { border-color: #1677ff; box-shadow: 0 0 0 3px rgba(22,119,255,.1); }
.form-actions { padding-top: 6px; }

/* ===== 提示 ===== */
.alert { padding: 11px 16px; border-radius: 6px; margin-bottom: 18px; font-size: 13.5px; }
.alert-ok { background: #eaf9f1; color: #07884a; border: 1px solid #c6efd9; }
.alert-err { background: #fdeeee; color: #c0392b; border: 1px solid #f7d4d1; }
.alert-info { background: #eef4ff; color: #1c5fd0; border: 1px solid #d3e2ff; }

.tag { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px; }
.tag-on { background: #eaf9f1; color: #07884a; }
.tag-off { background: #f0f2f5; color: #8b95a5; }
.tag-mock { background: #fff6e6; color: #b7791f; }
.tag-pending { background: #fff6e6; color: #b7791f; }
.tag-danger { background: #fdeeee; color: #c0392b; }

.empty { text-align: center; color: #98a2b3; padding: 40px 0; }

.pager { margin-top: 18px; }
.pager ul, .pagination { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0; flex-wrap: wrap; }
.pager li, .pagination li { display: inline-block; }
.pager a, .pager span, .pagination a, .pagination span {
    display: inline-block; padding: 5px 11px; border: 1px solid #d6dbe3;
    border-radius: 6px; font-size: 13px; color: #2c3038;
}
.pager .active span, .pagination .active span { background: #1677ff; border-color: #1677ff; color: #fff; }
.pager .disabled span, .pagination .disabled span { color: #c3cad4; }

.filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.filters .input, .filters select { width: auto; min-width: 160px; }

.code-box {
    background: #1f2733; color: #d6dbe3; border-radius: 8px; padding: 16px 18px;
    font-family: Consolas, Monaco, "Courier New", monospace; font-size: 12.5px;
    line-height: 1.8; overflow-x: auto; white-space: pre; margin: 0 0 12px;
}
.copy-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.copy-row .val {
    flex: 1; font-family: Consolas, Monaco, monospace; font-size: 12.5px;
    background: #f7f8fa; border: 1px solid #e4e8ee; border-radius: 6px; padding: 8px 12px;
    overflow-x: auto; white-space: nowrap;
}

/* ===== 登录 ===== */
.auth-wrap {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(140deg, #1f2733 0%, #2c3a4d 100%);
    padding: 24px;
}
.auth-card {
    width: 380px; background: #fff; border-radius: 14px; padding: 36px 34px;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.auth-card h1 { margin: 0 0 6px; font-size: 19px; text-align: center; }
.auth-card .sub { text-align: center; color: #98a2b3; font-size: 13px; margin-bottom: 26px; }
.auth-card .btn { width: 100%; padding: 10px; font-size: 14.5px; }

.steps { counter-reset: s; padding-left: 0; list-style: none; margin: 0; }
.steps li { position: relative; padding: 0 0 18px 34px; border-left: 2px solid #eef1f5; margin-left: 10px; }
.steps li:last-child { border-left-color: transparent; padding-bottom: 0; }
.steps li::before {
    counter-increment: s; content: counter(s);
    position: absolute; left: -13px; top: 0; width: 24px; height: 24px;
    background: #1677ff; color: #fff; border-radius: 50%;
    font-size: 12.5px; display: flex; align-items: center; justify-content: center;
}
.steps li b { display: block; margin-bottom: 3px; }
.steps li p { margin: 0; color: #6b7686; font-size: 13px; }
