:root {
    --primary: #3f5efb;
    --primary-dark: #2b3fd6;
    --primary-light: #eceffd;
    --success: #16a34a;
    --danger: #dc2626;
    --warning: #d97706;
    --text: #1f2937;
    --text-muted: #6b7280;
    --bg: #f1f3f9;
    --card: #ffffff;
    --border: #e5e7eb;
    --radius: 12px;
    --shadow: 0 2px 12px rgba(31, 41, 55, .08);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== 顶部导航 ===== */
.topnav {
    background: linear-gradient(90deg, var(--primary) 0%, #6a7bff 100%);
    color: #fff;
    padding: 0 24px;
    display: flex;
    align-items: center;
    height: 56px;
    box-shadow: 0 2px 10px rgba(63, 94, 251, .35);
    position: sticky;
    top: 0;
    z-index: 100;
}
.topnav .brand {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 1px;
    margin-right: 32px;
    white-space: nowrap;
}
.topnav .brand span { opacity: .75; font-size: 12px; font-weight: 400; margin-left: 6px; }
.topnav .menu { display: flex; flex: 1; flex-wrap: wrap; }
.topnav .menu a {
    color: rgba(255,255,255,.85);
    padding: 0 16px;
    line-height: 56px;
    display: block;
    font-size: 14px;
}
.topnav .menu a:hover { color: #fff; text-decoration: none; background: rgba(255,255,255,.12); }
.topnav .menu a.active { color: #fff; font-weight: 600; background: rgba(255,255,255,.18); }
.topnav .right { display: flex; align-items: center; gap: 14px; font-size: 13px; color: rgba(255,255,255,.9); }
.topnav .right a { color: #fff; }

.container { max-width: 1200px; margin: 24px auto; padding: 0 16px; }
.container.wide { max-width: 1400px; }

/* ===== 卡片 ===== */
.card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px;
    margin-bottom: 20px;
}
.card-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

/* ===== 统计块 ===== */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    border-left: 4px solid var(--primary);
}
.stat .num { font-size: 28px; font-weight: 700; color: var(--primary); }
.stat .label { color: var(--text-muted); font-size: 13px; margin-top: 2px; }
.stat.g2 { border-left-color: var(--success); } .stat.g2 .num { color: var(--success); }
.stat.g3 { border-left-color: var(--warning); } .stat.g3 .num { color: var(--warning); }
.stat.g4 { border-left-color: #8b5cf6; } .stat.g4 .num { color: #8b5cf6; }

/* ===== 表格 ===== */
table.tb { width: 100%; border-collapse: collapse; font-size: 14px; }
table.tb th, table.tb td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
table.tb th { background: #f8f9fd; font-weight: 600; color: #374151; white-space: nowrap; }
table.tb tr:hover td { background: #fafbff; }
table.tb td.center, table.tb th.center { text-align: center; }
.table-scroll { overflow-x: auto; }

/* ===== 表单 ===== */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.form-item label { display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 6px; font-weight: 600; }
.form-item input, .form-item select, .form-item textarea,
.inline-input {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border .2s, box-shadow .2s;
    background: #fff;
    color: var(--text);
}
.form-item input:focus, .form-item select:focus, .form-item textarea:focus,
.inline-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(63, 94, 251, .15);
}
.form-actions { margin-top: 16px; display: flex; gap: 10px; flex-wrap: wrap; }

.inline-input { width: 90px; padding: 6px 8px; }

/* ===== 按钮 ===== */
.btn {
    display: inline-block;
    padding: 9px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    background: linear-gradient(135deg, var(--primary), #6a7bff);
    color: #fff;
    transition: transform .15s, box-shadow .15s;
    white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(63, 94, 251, .35); text-decoration: none; }
.btn-sm { padding: 5px 12px; font-size: 13px; border-radius: 6px; }
.btn-outline { background: #fff; color: var(--primary); border: 1px solid var(--primary); }
.btn-outline:hover { background: var(--primary-light); box-shadow: none; }
.btn-success { background: linear-gradient(135deg, #16a34a, #22c55e); }
.btn-danger { background: linear-gradient(135deg, #dc2626, #ef4444); }
.btn-danger:hover { box-shadow: 0 4px 12px rgba(220,38,38,.35); }

/* ===== 提示 ===== */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; }
.alert-success { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.alert-error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.alert-info { background: var(--primary-light); color: var(--primary-dark); border: 1px solid #c7d2fe; }

/* ===== 标签 ===== */
.tag { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; }
.tag-blue { background: var(--primary-light); color: var(--primary-dark); }
.tag-green { background: #dcfce7; color: #15803d; }
.tag-red { background: #fee2e2; color: #b91c1c; }
.tag-gray { background: #f3f4f6; color: #6b7280; }

/* ===== 分页 ===== */
.pager { display: flex; gap: 6px; margin-top: 16px; flex-wrap: wrap; }
.pager a, .pager span {
    padding: 6px 12px; border-radius: 6px; border: 1px solid var(--border);
    font-size: 13px; color: var(--text-muted); background: #fff;
}
.pager .cur { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ===== 筛选条 ===== */
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 16px; }
.filter-bar .form-item { min-width: 150px; }
.filter-bar input, .filter-bar select { padding: 8px 10px; }

/* ===== 前台查询页 ===== */
.query-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #3f5efb 0%, #6a7bff 55%, #9db0ff 100%);
    padding: 20px;
}
.query-card {
    background: rgba(255,255,255,.96);
    border-radius: 18px;
    box-shadow: 0 20px 50px rgba(0,0,0,.25);
    padding: 40px 36px;
    width: 100%;
    max-width: 430px;
}
.query-card .logo {
    width: 62px; height: 62px; margin: 0 auto 16px;
    background: linear-gradient(135deg, var(--primary), #6a7bff);
    border-radius: 16px; display: flex; align-items: center; justify-content: center;
    font-size: 30px; color: #fff;
}
.query-card h1 { text-align: center; font-size: 22px; margin-bottom: 6px; }
.query-card .sub { text-align: center; color: var(--text-muted); font-size: 13px; margin-bottom: 26px; }
.query-card .form-item { margin-bottom: 16px; }
.query-card .btn { width: 100%; padding: 12px; font-size: 15px; }
.query-card .foot { text-align: center; margin-top: 20px; font-size: 12px; color: #9ca3af; }

/* ===== 成绩单 ===== */
.score-banner {
    background: linear-gradient(135deg, var(--primary), #6a7bff);
    border-radius: var(--radius);
    color: #fff;
    padding: 24px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}
.score-banner h2 { font-size: 20px; margin-bottom: 6px; }
.score-banner .meta { opacity: .9; font-size: 13px; }
.score-banner .total { text-align: right; }
.score-banner .total .n { font-size: 32px; font-weight: 700; }
.score-banner .total .l { font-size: 12px; opacity: .85; }
.score-item {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    padding: 12px 14px;
    border-bottom: 1px dashed var(--border);
    gap: 12px;
}
.score-item .bar-bg {
    grid-column: 1 / -1;
    height: 6px;
    background: #eef1f8;
    border-radius: 999px;
    overflow: hidden;
}
.score-item .bar {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--primary), #6a7bff);
}
.score-item .pass { color: var(--success); font-weight: 600; }
.score-item .fail { color: var(--danger); font-weight: 600; }

/* ===== 安装向导 ===== */
.install-wrap { max-width: 760px; margin: 40px auto; padding: 0 16px; }
.step-bar { display: flex; gap: 8px; margin-bottom: 20px; }
.step-bar .st { flex: 1; text-align: center; padding: 10px 0; background: #e5e7eb; color: #9ca3af; border-radius: 8px; font-size: 13px; }
.step-bar .st.on { background: var(--primary); color: #fff; font-weight: 600; }
.check-row { display: flex; justify-content: space-between; padding: 10px 4px; border-bottom: 1px dashed var(--border); }
.check-row .ok { color: var(--success); font-weight: 600; }
.check-row .no { color: var(--danger); font-weight: 600; }

/* ===== 工具 ===== */
.muted { color: var(--text-muted); font-size: 13px; }
.mt { margin-top: 16px; }
.right { text-align: right; }
.flex { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
@media (max-width: 768px) {
    .topnav {
        flex-direction: column;
        align-items: stretch;
        height: auto;
        padding: 0 12px 0;
        gap: 0;
    }
    .topnav .brand {
        margin-right: 0;
        line-height: 44px;
        font-size: 15px;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    .topnav .brand span { margin-left: 0; }
    .topnav .menu {
        flex: none;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
        margin: 0 -12px;
        padding: 0 12px;
        scrollbar-width: none;
    }
    .topnav .menu::-webkit-scrollbar { display: none; }
    .topnav .menu a {
        display: inline-block;
        line-height: 40px;
        padding: 0 12px;
        font-size: 13px;
    }
    .topnav .right {
        position: absolute;
        top: 0;
        right: 12px;
        line-height: 44px;
        font-size: 12px;
        gap: 10px;
    }
    .topnav { position: relative; }
    .topnav .brand { padding-right: 110px; }
    .container { margin: 14px auto; }
    .card { padding: 16px; }
    .score-banner { padding: 18px; }
    .score-banner .total { text-align: left; }
    .stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .stat { padding: 14px; }
    .stat .num { font-size: 22px; }
    .form-grid { grid-template-columns: 1fr; }
    .filter-bar .form-item { min-width: 0; flex: 1; }
}
