/* ============ 公安内网综合信息查询系统 · 主题样式 ============ */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --navy: #12305a;
    --navy-2: #1c4278;
    --navy-3: #152a44;
    --red: #c1272d;
    --gold: #e5b53c;
    --line: #d5dce6;
    --bg: #eef1f6;
    --text: #23303f;
    --muted: #7b8899;
}

html, body { height: 100%; }

body {
    font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Source Han Sans SC", "Noto Sans CJK SC", Arial, sans-serif;
    font-size: 13px;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

a { color: #17558f; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ================= 顶栏 ================= */
.topbar {
    height: 56px;
    display: flex;
    align-items: stretch;
    background: linear-gradient(180deg, #1c4278 0%, #12305a 100%);
    border-bottom: 3px solid var(--red);
    position: relative;
    z-index: 30;
}

.topbar .logo {
    width: 240px;
    flex: none;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    border-right: 1px solid rgba(255, 255, 255, .12);
    background: rgba(0, 0, 0, .10);
}

.emblem {
    width: 34px; height: 34px; flex: none;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 28%, #ffe08a 0%, #e5b53c 45%, #b8860b 100%);
    color: #8a1c1c;
    font-size: 16px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .35), 0 1px 3px rgba(0, 0, 0, .35);
    font-family: "KaiTi", "STKaiti", serif;
}

.logo-txt .t1 { color: #fff; font-size: 15px; font-weight: 600; letter-spacing: .5px; line-height: 1.15; }
.logo-txt .t2 { color: #9fb8da; font-size: 10px; letter-spacing: 1.2px; margin-top: 2px; }

.topnav { display: flex; align-items: stretch; }
.topnav a {
    display: flex; align-items: center;
    padding: 0 18px;
    color: #c8d9ef;
    font-size: 13px;
    text-decoration: none;
    border-right: 1px solid rgba(255, 255, 255, .07);
    transition: background .15s;
}
.topnav a:hover { background: rgba(255, 255, 255, .09); color: #fff; text-decoration: none; }
.topnav a.active {
    background: rgba(255, 255, 255, .12);
    color: #fff;
    box-shadow: inset 0 -3px 0 var(--gold);
}

.topbar-right {
    margin-left: auto;
    display: flex; align-items: center; gap: 14px;
    padding-right: 16px;
    color: #aec6e4;
    font-size: 12px;
}
.topbar-right .clock { font-family: Consolas, Monaco, monospace; color: #dfe9f7; letter-spacing: .5px; }
.topbar-right .user-chip {
    display: flex; align-items: center; gap: 7px;
    padding: 4px 10px 4px 4px;
    border-radius: 14px;
    background: rgba(255, 255, 255, .10);
    color: #eaf2ff;
}
.avatar {
    width: 22px; height: 22px; border-radius: 50%;
    background: linear-gradient(135deg, #4f7fc4, #2a5aa0);
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; color: #fff;
    border: 1px solid rgba(255, 255, 255, .35);
}
.topbar-right a.logout {
    color: #ffd2d2; font-size: 12px; text-decoration: none;
    padding: 3px 8px; border: 1px solid rgba(255, 120, 120, .45); border-radius: 2px;
}
.topbar-right a.logout:hover { background: rgba(193, 39, 45, .35); text-decoration: none; }

/* ================= 布局 ================= */
.layout { display: flex; align-items: stretch; min-height: calc(100vh - 56px); }

.sidebar {
    width: 240px; flex: none;
    background: var(--navy-3);
    padding: 6px 0 30px;
    overflow-y: auto;
}
.nav-group {
    padding: 14px 16px 6px;
    font-size: 11px;
    color: #5f7ea6;
    letter-spacing: 2px;
}
.nav-item {
    display: flex; align-items: center; gap: 9px;
    padding: 10px 16px;
    color: #bfd0e6;
    font-size: 13px;
    border-left: 3px solid transparent;
    cursor: pointer;
}
.nav-item:hover { background: #1d3a5c; color: #fff; text-decoration: none; }
.nav-item.active {
    background: #1b3c60;
    color: #fff;
    border-left-color: var(--red);
    font-weight: 600;
}
.nav-item .ico { width: 15px; text-align: center; opacity: .85; font-size: 12px; }
.nav-item .badge {
    margin-left: auto;
    background: rgba(193, 39, 45, .85);
    color: #fff; font-size: 10px;
    padding: 1px 5px; border-radius: 8px;
}
.nav-item.disabled { color: #62748c; cursor: not-allowed; }
.nav-item.disabled:hover { background: transparent; color: #62748c; }

.main { flex: 1; min-width: 0; padding: 14px 18px 34px; }

/* ================= 面包屑 ================= */
.crumb {
    font-size: 12px; color: var(--muted);
    margin-bottom: 10px;
    display: flex; align-items: center; gap: 6px;
}
.crumb .sep { color: #c3ccd8; }
.crumb .cur { color: #3a4a5e; }

/* ================= 卡片 ================= */
.card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(16, 36, 66, .05);
    margin-bottom: 14px;
}
.card-hd {
    height: 38px;
    display: flex; align-items: center;
    padding: 0 14px;
    border-bottom: 1px solid #e3e8f0;
    background: #f7f9fc;
    font-size: 13px; font-weight: 600; color: #1c3557;
}
.card-hd::before {
    content: ''; width: 3px; height: 14px;
    background: var(--red); margin-right: 9px; border-radius: 1px;
}
.card-hd .hd-right { margin-left: auto; font-weight: 400; font-size: 12px; color: var(--muted); display: flex; gap: 10px; align-items: center; }
.card-bd { padding: 14px; }
.card-bd.tight { padding: 0; }

/* ================= 表格 ================= */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th {
    background: #e9eef7;
    color: #1c3557;
    font-weight: 600;
    text-align: left;
    padding: 9px 10px;
    border: 1px solid var(--line);
    white-space: nowrap;
}
.tbl td { padding: 8px 10px; border: 1px solid #e1e6ee; vertical-align: middle; }
.tbl tbody tr:nth-child(even) { background: #f7f9fc; }
.tbl tbody tr:hover { background: #eaf1fb; }
.tbl .num { font-family: Consolas, Monaco, monospace; }
.tbl .center { text-align: center; }
.tbl .ops a { margin-right: 8px; font-size: 12px; }
.tbl-empty { padding: 40px 0; text-align: center; color: #9aa7b8; font-size: 13px; }

/* ================= 表单 ================= */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 10px 18px;
}
.field { display: flex; align-items: center; gap: 8px; }
.field > label {
    width: 78px; flex: none;
    text-align: right; color: #44546b; font-size: 13px;
}
.field .req::after { content: '*'; color: var(--red); margin-left: 2px; }

input[type=text], input[type=password], input[type=date], input[type=number], select, textarea {
    height: 30px;
    padding: 0 8px;
    border: 1px solid #c6cfdb;
    border-radius: 2px;
    font-size: 13px;
    color: #23303f;
    background: #fff;
    font-family: inherit;
    outline: none;
    width: 100%;
    transition: border-color .15s, box-shadow .15s;
}
textarea { height: auto; padding: 6px 8px; line-height: 1.6; resize: vertical; }
input:focus, select:focus, textarea:focus {
    border-color: #3d7bc4;
    box-shadow: 0 0 0 2px rgba(61, 123, 196, .15);
}
input:disabled, input[readonly] { background: #f2f4f8; color: #6a7787; }

.form-actions {
    display: flex; gap: 8px; align-items: center;
    padding-top: 12px; margin-top: 12px;
    border-top: 1px dashed #e0e6ef;
}

/* ================= 按钮 ================= */
.btn {
    display: inline-flex; align-items: center; gap: 5px;
    height: 30px; padding: 0 16px;
    font-size: 13px; font-family: inherit;
    border-radius: 2px; cursor: pointer;
    border: 1px solid #c6cfdb;
    background: linear-gradient(180deg, #fff, #f2f5f9);
    color: #33455c;
    text-decoration: none;
    transition: all .15s;
    white-space: nowrap;
}
.btn:hover { border-color: #9fb0c6; color: #1c3557; text-decoration: none; }
.btn-primary {
    background: linear-gradient(180deg, #2a5da3, #1a4076);
    border-color: #14325a; color: #fff;
    box-shadow: 0 1px 2px rgba(16, 36, 66, .2);
}
.btn-primary:hover { background: linear-gradient(180deg, #326cba, #1e4a86); color: #fff; }
.btn-danger { background: linear-gradient(180deg, #d2454b, #b02026); border-color: #9c1c22; color: #fff; }
.btn-danger:hover { background: linear-gradient(180deg, #dc565c, #bd2a30); color: #fff; }
.btn-sm { height: 25px; padding: 0 10px; font-size: 12px; }
.btn-ghost { background: transparent; border-color: transparent; color: #17558f; }
.btn-ghost:hover { background: #eef4fc; }

/* ================= 标签 ================= */
.tag {
    display: inline-block;
    padding: 1px 7px;
    font-size: 11px;
    line-height: 17px;
    border-radius: 2px;
    border: 1px solid transparent;
    white-space: nowrap;
}
.tag-gray   { background: #f0f3f7; color: #64748b; border-color: #dfe5ee; }
.tag-blue   { background: #e8f1fd; color: #1a5fae; border-color: #c4dcf7; }
.tag-green  { background: #e9f7ee; color: #1e7a45; border-color: #c3e6d1; }
.tag-red    { background: #fdeced; color: #b02026; border-color: #f5c9cb; }
.tag-orange { background: #fff5e6; color: #a8620b; border-color: #fadfb6; }
.tag-purple { background: #f3edfd; color: #6a3fb5; border-color: #ddd0f7; }

/* ================= 提示条 ================= */
.alert {
    padding: 9px 14px;
    border-radius: 2px;
    font-size: 13px;
    margin-bottom: 12px;
    border: 1px solid transparent;
}
.alert-ok   { background: #edf8f1; border-color: #c3e6d1; color: #1e7a45; }
.alert-err  { background: #fdecee; border-color: #f5c9cb; color: #b02026; }
.alert-warn { background: #fff8e9; border-color: #fadfb6; color: #8a5208; }

/* ================= 统计卡 ================= */
.stat-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}
.stat {
    background: #fff;
    border: 1px solid var(--line);
    border-top: 3px solid #2a5da3;
    padding: 14px 16px;
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(16, 36, 66, .05);
    position: relative;
    overflow: hidden;
}
.stat.red    { border-top-color: var(--red); }
.stat.green  { border-top-color: #2f9e5f; }
.stat.orange { border-top-color: #e09421; }
.stat .k { font-size: 12px; color: var(--muted); }
.stat .v { font-size: 26px; font-weight: 700; color: #1c3557; font-family: Consolas, Monaco, monospace; margin-top: 6px; line-height: 1; }
.stat .v small { font-size: 12px; font-weight: 400; color: var(--muted); margin-left: 3px; font-family: inherit; }
.stat .bar { position: absolute; right: -10px; bottom: -10px; font-size: 52px; opacity: .05; }

/* ================= 详情键值 ================= */
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 0; }
.kv .item {
    display: flex;
    padding: 9px 12px;
    border-bottom: 1px solid #eef1f6;
    font-size: 13px;
    line-height: 1.6;
}
.kv .item .k { width: 92px; flex: none; color: var(--muted); }
.kv .item .v { color: #23303f; word-break: break-all; }

/* ================= 档案头 ================= */
.profile {
    display: flex; gap: 16px;
    padding: 16px;
    background: linear-gradient(180deg, #f8fafd, #fff);
    border-bottom: 1px solid #e3e8f0;
}
.profile .photo {
    width: 92px; height: 118px; flex: none;
    border: 1px solid #c6cfdb;
    background: #eef1f6 url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='92' height='118'><rect width='92' height='118' fill='%23eef1f6'/><circle cx='46' cy='46' r='19' fill='%23c6cfdb'/><path d='M12 118c0-20 15-32 34-32s34 12 34 32z' fill='%23c6cfdb'/></svg>") center/cover no-repeat;
}
.profile .pinfo { flex: 1; min-width: 0; }
.profile .pname { font-size: 20px; font-weight: 700; color: #16304f; letter-spacing: 1px; }
.profile .pname .tag { vertical-align: middle; margin-left: 8px; font-weight: 400; }
.profile .pid { font-size: 13px; color: #4a5c72; margin-top: 6px; font-family: Consolas, Monaco, monospace; letter-spacing: .5px; }
.profile .pmeta { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 12px; color: #5c6c80; }
.profile .pmeta b { color: #23303f; font-weight: 600; }

/* ================= 分页 ================= */
.pager {
    display: flex; align-items: center; gap: 4px;
    padding: 12px 14px;
    border-top: 1px solid #eef1f6;
    font-size: 12px;
}
.pager .pg-info { color: var(--muted); margin-right: auto; }
.pager .pg {
    min-width: 28px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0 8px;
    border: 1px solid #d5dce6;
    background: #fff; color: #33455c;
    border-radius: 2px;
}
.pager .pg:hover { border-color: #2a5da3; color: #1a4076; text-decoration: none; }
.pager .pg.on { background: #1a4076; border-color: #14325a; color: #fff; font-weight: 600; }
.pager .pg.disabled { color: #b7c1cd; pointer-events: none; background: #f7f9fc; }

/* ================= 登录页 ================= */
.login-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at 50% 0%, rgba(40, 90, 160, .38), transparent 62%),
        linear-gradient(160deg, #0b1c33 0%, #102c50 45%, #0a1728 100%);
    display: flex; align-items: center; justify-content: center;
    position: relative;
    overflow: hidden;
}
.login-page::before {
    content: '';
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
    background-size: 44px 44px;
}
.login-box {
    position: relative;
    width: 396px;
    background: #fff;
    border-radius: 3px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .5);
    overflow: hidden;
}
.login-box .lh {
    background: linear-gradient(180deg, #1c4278, #12305a);
    padding: 22px 24px 18px;
    text-align: center;
    border-bottom: 3px solid var(--red);
}
.login-box .lh .emblem { margin: 0 auto 10px; width: 46px; height: 46px; font-size: 21px; }
.login-box .lh h1 { color: #fff; font-size: 17px; font-weight: 600; letter-spacing: 1.5px; }
.login-box .lh p { color: #9fb8da; font-size: 11px; letter-spacing: 2px; margin-top: 6px; }
.login-box form { padding: 24px 26px 8px; }
.login-box .lf { margin-bottom: 14px; }
.login-box .lf label { display: block; font-size: 12px; color: #55677d; margin-bottom: 6px; }
.login-box .lf input {
    height: 38px;
    padding: 0 12px;
    border: 1px solid #c6cfdb;
    border-radius: 2px;
    font-size: 14px;
}
.login-box .lf input:focus { border-color: #2a5da3; box-shadow: 0 0 0 3px rgba(42, 93, 163, .13); }
.login-box .btn-login {
    width: 100%; height: 40px; margin-top: 6px;
    background: linear-gradient(180deg, #2a5da3, #1a4076);
    border: 1px solid #14325a;
    color: #fff; font-size: 15px; letter-spacing: 4px;
    border-radius: 2px; cursor: pointer; font-family: inherit;
}
.login-box .btn-login:hover { background: linear-gradient(180deg, #326cba, #1e4a86); }
.login-box .lhint {
    padding: 0 26px 16px;
    font-size: 11px; color: #93a1b3; line-height: 1.9;
}
.login-box .lhint code {
    background: #f0f3f8; padding: 1px 5px; border-radius: 2px;
    font-family: Consolas, Monaco, monospace; color: #3b5270;
}
.login-err {
    margin: 0 26px 12px;
    background: #fdecee; border: 1px solid #f5c9cb; color: #b02026;
    padding: 8px 12px; font-size: 12px; border-radius: 2px;
}
.login-foot {
    position: absolute; bottom: 18px; left: 0; right: 0;
    text-align: center; color: #5c7799; font-size: 11px; letter-spacing: .5px;
}

/* ================= 页脚状态栏 ================= */
.statusbar {
    height: 26px;
    background: #e6ebf3;
    border-top: 1px solid #d5dce6;
    display: flex; align-items: center;
    padding: 0 14px;
    font-size: 11px; color: #6a7d93;
    gap: 18px;
}
.statusbar .dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: #2f9e5f; display: inline-block; margin-right: 5px;
    box-shadow: 0 0 0 2px rgba(47, 158, 95, .18);
}
.statusbar .right { margin-left: auto; }

/* ================= 工具类 ================= */
.mono { font-family: Consolas, Monaco, monospace; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mt8 { margin-top: 8px; }
.mt14 { margin-top: 14px; }
.mb0 { margin-bottom: 0; }
.nowrap { white-space: nowrap; }
.text-red { color: var(--red); }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.anchor-nav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.anchor-nav a {
    padding: 5px 12px; background: #fff; border: 1px solid var(--line);
    font-size: 12px; color: #3a4a5e; border-radius: 2px;
}
.anchor-nav a:hover { border-color: #2a5da3; color: #1a4076; text-decoration: none; background: #f4f8fe; }

/* 打印 */
@media print {
    .topbar, .sidebar, .statusbar, .crumb, .btn, .pager, .anchor-nav { display: none !important; }
    .main { padding: 0; }
    .card { border: none; box-shadow: none; }
}

@media (max-width: 900px) {
    .topnav { display: none; }
    .sidebar { width: 180px; }
    .kv { grid-template-columns: 1fr; }
}
