/* ==========================================================================
   全国人口信息查询系统 · 界面样式
   配色：藏青 #0d2b57 / 深红 #b8262b / 浅灰底 #eef2f7
   ========================================================================== */

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
}

body {
    padding-bottom: 30px;
    font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Source Han Sans CN", system-ui, sans-serif;
    font-size: 13px;
    color: #22303f;
    background: #eef2f7;
    -webkit-font-smoothing: antialiased;
}

a { color: #1d5aa8; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ------------------------------ 顶栏 ------------------------------ */
.topbar {
    height: 58px;
    background: linear-gradient(180deg, #123a6b 0%, #0d2b57 100%);
    display: flex;
    align-items: center;
    padding: 0 18px;
    color: #fff;
    position: relative;
    box-shadow: 0 1px 0 rgba(255, 255, 255, .08) inset;
}
.topbar::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 3px;
    background: linear-gradient(90deg, #b8262b 0%, #d4483f 50%, #b8262b 100%);
}
.topbar .emblem {
    width: 34px; height: 34px;
    margin-right: 12px;
    flex: 0 0 auto;
}
.topbar .brand { display: flex; flex-direction: column; line-height: 1.15; }
.topbar .brand b {
    font-size: 18px;
    letter-spacing: 2px;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
}
.topbar .brand span {
    font-size: 10px;
    color: #9fb9dd;
    letter-spacing: 3px;
    margin-top: 3px;
}
.topbar .spacer { flex: 1; }
.topbar .meta {
    display: flex;
    align-items: center;
    gap: 18px;
    font-size: 12px;
    color: #c6d8f0;
}
.topbar .meta .who b { color: #fff; font-weight: 600; margin-right: 4px; }
.topbar .meta .clock { font-family: Consolas, "Courier New", monospace; letter-spacing: .5px; color: #fff; }
.topbar .logout {
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .35);
    padding: 5px 12px;
    border-radius: 3px;
    font-size: 12px;
    transition: .15s;
}
.topbar .logout:hover { background: rgba(255, 255, 255, .14); text-decoration: none; }

/* ------------------------------ 布局 ------------------------------ */
.layout { display: flex; min-height: calc(100vh - 58px - 30px); }

/* ------------------------------ 底部状态栏 ------------------------------ */
.statusbar {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 20;
    height: 30px;
    background: #e9eef5;
    border-top: 1px solid #d6e0ec;
    color: #5b6b7d;
    font-size: 11.5px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 16px;
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
    white-space: nowrap;
    overflow: hidden;
}
.statusbar .sep { color: #c2cedd; margin: 0 2px; }
.statusbar .dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: #2f9e5f;
    box-shadow: 0 0 0 3px rgba(47, 158, 95, .15);
    flex: 0 0 auto;
}
.statusbar .right { margin-left: auto; color: #8a99aa; }
@media (max-width: 900px) { .statusbar .sep, .statusbar .right { display: none; } }

.sidebar {
    width: 196px;
    flex: 0 0 196px;
    background: #0c2447;
    padding: 12px 0 24px;
    color: #b9cde9;
    border-right: 1px solid #163561;
}
.sidebar .group {
    font-size: 11px;
    color: #6f8cb4;
    letter-spacing: 2px;
    padding: 14px 18px 6px;
}
.sidebar a {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 18px 10px 20px;
    color: #b9cde9;
    font-size: 13.5px;
    border-left: 3px solid transparent;
    transition: .12s;
}
.sidebar a:hover {
    background: #10305a;
    color: #fff;
    text-decoration: none;
}
.sidebar a.active {
    background: #17427a;
    color: #fff;
    border-left-color: #d4483f;
    font-weight: 600;
}
.sidebar a .ico { width: 15px; height: 15px; opacity: .85; flex: 0 0 auto; }
.sidebar .foot {
    margin: 26px 14px 0;
    padding-top: 14px;
    border-top: 1px dashed rgba(255, 255, 255, .12);
    font-size: 11px;
    color: #5f7ba0;
    line-height: 1.8;
}

.main {
    flex: 1;
    padding: 16px 20px 40px;
    min-width: 0;
}

.crumb {
    font-size: 12px;
    color: #6b7b8d;
    margin-bottom: 12px;
}
.crumb b { color: #22303f; font-weight: 600; }

/* ------------------------------ 卡片 ------------------------------ */
.panel {
    background: #fff;
    border: 1px solid #dbe3ec;
    border-radius: 3px;
    margin-bottom: 16px;
    box-shadow: 0 1px 2px rgba(16, 42, 74, .05);
}
.panel > .hd {
    height: 40px;
    display: flex;
    align-items: center;
    padding: 0 14px;
    border-bottom: 1px solid #e4eaf2;
    background: #f7fafd;
    font-weight: 600;
    color: #16406f;
    font-size: 13.5px;
}
.panel > .hd::before {
    content: "";
    width: 3px; height: 14px;
    background: #b8262b;
    margin-right: 9px;
    border-radius: 1px;
}
.panel > .hd .right { margin-left: auto; font-weight: 400; font-size: 12px; color: #7b8a9b; }
.panel > .bd { padding: 16px 14px; }
.panel > .bd.tight { padding: 0; }

/* ------------------------------ 表单 ------------------------------ */
.form-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px 18px;
}
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 12px; color: #5b6b7d; }
.field input[type=text],
.field input[type=date],
.field input[type=password],
.field select {
    height: 32px;
    border: 1px solid #cfd9e6;
    border-radius: 3px;
    padding: 0 9px;
    font-size: 13px;
    color: #22303f;
    background: #fff;
    font-family: inherit;
    width: 100%;
}
.field input:focus, .field select:focus {
    outline: none;
    border-color: #2f6fc4;
    box-shadow: 0 0 0 2px rgba(47, 111, 196, .12);
}
.form-actions {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px dashed #e2e9f2;
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 32px;
    padding: 0 18px;
    border-radius: 3px;
    border: 1px solid #1f4f95;
    background: linear-gradient(180deg, #2f6fc4, #23579f);
    color: #fff;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    letter-spacing: .5px;
    transition: .12s;
}
.btn:hover { background: linear-gradient(180deg, #3a83dd, #2860ad); text-decoration: none; }
.btn.ghost {
    background: #fff;
    color: #33506f;
    border-color: #cbd7e5;
}
.btn.ghost:hover { background: #f2f6fb; }
.btn.danger {
    background: linear-gradient(180deg, #c33c31, #a82b22);
    border-color: #96251d;
}
.btn.danger:hover { background: linear-gradient(180deg, #d5483c, #b93329); }
.btn.sm { height: 26px; padding: 0 11px; font-size: 12px; }

/* ------------------------------ 表格 ------------------------------ */
.tbl-wrap { overflow-x: auto; }
table.tbl {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
    white-space: nowrap;
}
table.tbl th {
    background: #eef3f9;
    color: #16406f;
    font-weight: 600;
    text-align: left;
    padding: 9px 12px;
    border-bottom: 1px solid #dbe4ef;
    position: sticky;
    top: 0;
    z-index: 1;
}
table.tbl td {
    padding: 9px 12px;
    border-bottom: 1px solid #edf1f7;
    color: #2b3a4a;
}
table.tbl tbody tr:nth-child(even) { background: #fbfdff; }
table.tbl tbody tr:hover { background: #f1f7ff; }
table.tbl .num { text-align: right; font-family: Consolas, monospace; }
table.tbl .mono { font-family: Consolas, "Courier New", monospace; letter-spacing: .3px; }
.tbl-empty { padding: 46px 0; text-align: center; color: #93a3b5; font-size: 13px; }

/* 整表无内边距时左右留白 */
.panel > .bd.tight table.tbl th:first-child,
.panel > .bd.tight table.tbl td:first-child { padding-left: 14px; }

/* ------------------------------ 徽标 ------------------------------ */
.badge {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 2px;
    font-size: 11.5px;
    line-height: 18px;
    border: 1px solid transparent;
    vertical-align: middle;
}
.badge-green  { background: #e7f6ec; color: #187a3b; border-color: #bfe4cc; }
.badge-red    { background: #fdeaea; color: #b8262b; border-color: #f3c6c6; }
.badge-orange { background: #fff3e2; color: #b56414; border-color: #f3d9b3; }
.badge-blue   { background: #e8f1fd; color: #1d5aa8; border-color: #c4daf6; }
.badge-gray   { background: #f0f3f7; color: #5d6b7a; border-color: #dde4ec; }

/* ------------------------------ 分页 ------------------------------ */
.pager {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 14px;
    border-top: 1px solid #edf1f7;
    font-size: 12.5px;
    color: #6b7b8d;
    flex-wrap: wrap;
}
.pager a, .pager span.cur, .pager span.dis {
    min-width: 28px;
    height: 26px;
    line-height: 24px;
    text-align: center;
    padding: 0 8px;
    border: 1px solid #d7e0eb;
    border-radius: 2px;
    background: #fff;
    color: #33506f;
}
.pager a:hover { border-color: #2f6fc4; color: #1d5aa8; text-decoration: none; }
.pager span.cur { background: #23579f; border-color: #23579f; color: #fff; }
.pager span.dis { color: #b6c1cd; background: #f7f9fc; }
.pager .info { margin-left: auto; color: #7b8a9b; }

/* ------------------------------ 详情页 ------------------------------ */
.detail-top {
    display: flex;
    gap: 20px;
    padding: 4px 2px 18px;
    border-bottom: 1px solid #eaf0f7;
    margin-bottom: 18px;
}
.photo-box {
    width: 108px;
    flex: 0 0 108px;
    height: 140px;
    border: 1px solid #d5dfeb;
    background: #f4f7fb;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 2px;
}
.photo-box img { width: 100%; height: 100%; object-fit: cover; display: block; }
.detail-top .headline { flex: 1; min-width: 0; }
.detail-top h2 {
    margin: 2px 0 10px;
    font-size: 22px;
    letter-spacing: 2px;
    color: #14365f;
}
.detail-top .tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.detail-top .kv { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 22px; font-size: 13px; }
.detail-top .kv div { color: #41546a; }
.detail-top .kv label { color: #8695a6; display: inline-block; min-width: 62px; }

.info-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    border-top: 1px solid #eaf0f7;
    border-left: 1px solid #eaf0f7;
}
.info-grid .cell {
    border-right: 1px solid #eaf0f7;
    border-bottom: 1px solid #eaf0f7;
    padding: 9px 12px;
    font-size: 13px;
    min-height: 38px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.info-grid .cell .k {
    color: #8695a6;
    flex: 0 0 76px;
    font-size: 12px;
}
.info-grid .cell .v { color: #22303f; word-break: break-all; }
.info-grid .cell.span2 { grid-column: span 2; }
.info-grid .cell.span4 { grid-column: span 4; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid #dbe4ef; padding: 0 14px; background: #f7fafd; }
.tabs a {
    padding: 10px 16px;
    font-size: 13px;
    color: #5b6b7d;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}
.tabs a:hover { color: #1d5aa8; text-decoration: none; }
.tabs a.on { color: #16406f; font-weight: 600; border-bottom-color: #b8262b; background: #fff; }
.tab-body { padding: 0; }

/* ------------------------------ 统计卡 ------------------------------ */
.stat-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}
.stat {
    background: #fff;
    border: 1px solid #dbe3ec;
    border-radius: 3px;
    padding: 15px 16px;
    position: relative;
    overflow: hidden;
}
.stat::after {
    content: "";
    position: absolute;
    right: -18px; top: -18px;
    width: 62px; height: 62px;
    border-radius: 50%;
    background: rgba(47, 111, 196, .07);
}
.stat .t { font-size: 12px; color: #7b8a9b; margin-bottom: 8px; }
.stat .n { font-size: 26px; font-weight: 700; color: #14365f; font-family: Consolas, "Microsoft YaHei", sans-serif; }
.stat .n small { font-size: 12px; font-weight: 400; color: #93a3b5; margin-left: 4px; }
.stat.red .n { color: #b8262b; }

/* ------------------------------ 登录页 ------------------------------ */
.login-wrap {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #0a1f3d;
    background-image:
        radial-gradient(circle at 18% 12%, rgba(40, 100, 190, .45), transparent 55%),
        radial-gradient(circle at 82% 88%, rgba(160, 35, 40, .28), transparent 52%),
        linear-gradient(160deg, #0a1f3d 0%, #0b2847 60%, #081a33 100%);
    padding: 24px;
    position: relative;
}
.login-wrap::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(120, 170, 230, .05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(120, 170, 230, .05) 1px, transparent 1px);
    background-size: 46px 46px;
    pointer-events: none;
}
.login-head {
    text-align: center;
    margin-bottom: 24px;
    position: relative;
    z-index: 1;
}
.login-head .emblem { width: 62px; height: 62px; margin-bottom: 10px; }
.login-head h1 {
    margin: 0;
    color: #fff;
    font-size: 28px;
    letter-spacing: 5px;
    font-weight: 700;
    text-shadow: 0 2px 12px rgba(0, 0, 0, .55);
}
.login-head p {
    margin: 9px 0 0;
    color: #8fb0d8;
    font-size: 12px;
    letter-spacing: 4px;
}
.login-card {
    width: 372px;
    max-width: 92vw;
    background: rgba(9, 27, 52, .92);
    border: 1px solid rgba(90, 140, 210, .38);
    border-radius: 6px;
    box-shadow: 0 26px 70px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .03) inset;
    padding: 26px 30px 22px;
    position: relative;
    z-index: 1;
    backdrop-filter: blur(2px);
}
.login-card::before {
    content: "";
    position: absolute;
    left: 0; right: 0; top: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #b8262b, transparent);
}
.login-card .row { margin-bottom: 14px; }
.login-card label { display: block; font-size: 12px; color: #93b0d3; margin-bottom: 6px; letter-spacing: 1px; }
.login-card input[type=text],
.login-card input[type=password] {
    width: 100%;
    height: 38px;
    border: 1px solid rgba(110, 155, 210, .35);
    background: rgba(255, 255, 255, .06);
    color: #fff;
    border-radius: 3px;
    padding: 0 11px;
    font-size: 14px;
    font-family: inherit;
    letter-spacing: 1px;
}
.login-card input:focus {
    outline: none;
    border-color: #4a86cf;
    background: rgba(255, 255, 255, .1);
    box-shadow: 0 0 0 3px rgba(74, 134, 207, .18);
}
.login-card .captcha-row { display: flex; gap: 10px; }
.login-card .captcha-row input { flex: 1; }
.login-card .captcha-img {
    width: 104px;
    height: 38px;
    border: 1px solid rgba(110, 155, 210, .35);
    border-radius: 3px;
    cursor: pointer;
    background: #f2f6fb;
    flex: 0 0 104px;
}
.login-card button {
    width: 100%;
    height: 40px;
    margin-top: 6px;
    border: 1px solid #2c62a8;
    border-radius: 3px;
    background: linear-gradient(180deg, #3676cd, #23579f);
    color: #fff;
    font-size: 15px;
    letter-spacing: 6px;
    font-family: inherit;
    cursor: pointer;
    transition: .15s;
}
.login-card button:hover { background: linear-gradient(180deg, #4287e0, #2860ad); }
.login-err {
    background: rgba(184, 38, 43, .18);
    border: 1px solid rgba(210, 80, 80, .45);
    color: #ffc4c4;
    font-size: 12.5px;
    padding: 8px 11px;
    border-radius: 3px;
    margin-bottom: 14px;
}
.login-foot {
    margin-top: 22px;
    color: #6b86a8;
    font-size: 11px;
    text-align: center;
    letter-spacing: 1px;
    line-height: 1.9;
    position: relative;
    z-index: 1;
}
.login-foot .warn { color: #b98a8a; }
.login-tips {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px dashed rgba(110, 155, 210, .25);
    font-size: 11px;
    color: #6b86a8;
    line-height: 1.9;
}

/* ------------------------------ 提示条 ------------------------------ */
.alert {
    padding: 10px 14px;
    border-radius: 3px;
    font-size: 13px;
    margin-bottom: 14px;
    border: 1px solid transparent;
}
.alert-err { background: #fdeaea; border-color: #f3c6c6; color: #a8261f; }
.alert-ok  { background: #eaf7ef; border-color: #bfe4cc; color: #187a3b; }
.alert-info{ background: #eef4fd; border-color: #cadcf5; color: #1d5aa8; }

/* ------------------------------ 核验页 ------------------------------ */
.verify-hero {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}
.verify-result {
    flex: 1;
    border: 1px solid #dbe4ef;
    border-radius: 3px;
    overflow: hidden;
}
.verify-result .top {
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}
.verify-result .top.ok { background: #eaf7ef; color: #187a3b; border-bottom: 1px solid #c8e6d3; }
.verify-result .top.no { background: #fdeaea; color: #a8261f; border-bottom: 1px solid #f0c8c4; }
.verify-result .top.warn { background: #fff5e6; color: #a86411; border-bottom: 1px solid #f0dfc0; }
.verify-body { padding: 4px 0; }

/* ------------------------------ 打印 ------------------------------ */
@media print {
    .topbar, .sidebar, .form-actions, .pager, .tabs { display: none !important; }
    body { background: #fff; }
    .layout { display: block; }
    .main { padding: 0; }
    .panel { border: none; box-shadow: none; }
}

/* ------------------------------ 录入 / 编辑 ------------------------------ */
.edit-wrap { display: flex; gap: 18px; align-items: flex-start; padding: 4px 0; }
.photo-col { width: 176px; flex: 0 0 176px; text-align: center; }
.photo-preview {
    width: 160px; height: 200px; margin: 0 auto;
    border: 1px solid #d5dfeb; background: #f4f7fb; border-radius: 2px;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden; color: #a8b6c6; font-size: 12px;
}
.photo-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.upload-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    height: 30px; padding: 0 12px; margin-top: 10px;
    border: 1px solid #cfd9e6; border-radius: 3px; background: #fff;
    color: #2f6fc4; font-size: 12px; cursor: pointer;
}
.upload-btn:hover { background: #f2f6fb; }
.upload-btn input[type=file] { display: none; }
.del-photo { display: inline-block; margin-top: 8px; font-size: 12px; color: #b8262b; }
.photo-tip { margin-top: 8px; font-size: 11px; line-height: 1.6; color: #93a3b5; text-align: left; }
.edit-main { flex: 1; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field textarea {
    min-height: 62px; border: 1px solid #cfd9e6; border-radius: 3px;
    padding: 7px 9px; font-size: 13px; color: #22303f; background: #fff;
    font-family: inherit; resize: vertical; width: 100%;
}
.field textarea:focus { outline: none; border-color: #2f6fc4; box-shadow: 0 0 0 2px rgba(47,111,196,.12); }
.form-grid .span2 { grid-column: span 2; }
.hint { margin-top: 10px; padding: 8px 10px; background: #f5f9ff; border-left: 2px solid #2f6fc4; color: #4d6480; font-size: 12px; line-height: 1.7; }
.switch-line { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #5b6b7d; margin: 10px 0 0; }
.switch-line input { width: 14px; height: 14px; }
.grow { flex: 1; }
.btn-ghost { border: 1px solid #cfd9e6; background: #fff; color: #38495c; }
.btn-ghost:hover { background: #f2f6fb; }
.btn-danger { border: 1px solid #e3b7b3; background: #fff; color: #b8262b; }
.btn-danger:hover { background: #fdf1f0; }
.cur-row td { background: #eef6ff !important; font-weight: 600; }
.avatar {
    width: 34px; height: 42px; object-fit: cover; border: 1px solid #dbe4ef;
    background: #f4f7fb; border-radius: 2px; display: inline-block; vertical-align: middle;
}
.avatar.sm { width: 26px; height: 32px; }
.avatar.lg { width: 96px; height: 120px; }
table.table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.table th, table.table td { padding: 7px 10px; border-bottom: 1px solid #edf1f7; text-align: left; }
table.table thead th { background: #f7fafd; color: #5b6b7d; font-weight: 600; font-size: 12px; }

/* ------------------------------ 响应式 ------------------------------ */
@media (max-width: 1200px) {
    .form-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .info-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .info-grid .cell.span4 { grid-column: span 3; }
    .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .detail-top .kv { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
    .sidebar { width: 58px; flex: 0 0 58px; }
    .sidebar a span.txt, .sidebar .group, .sidebar .foot { display: none; }
    .sidebar a { justify-content: center; padding: 12px 0; }
    .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .info-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .info-grid .cell.span4 { grid-column: span 2; }
    .verify-hero { flex-direction: column; }
}
@media (max-width: 620px) {
    .main { padding: 12px 10px 30px; }
    .topbar .brand span { display: none; }
    .topbar .meta .who, .topbar .meta .clock { display: none; }
    .form-grid { grid-template-columns: 1fr; }
    .info-grid { grid-template-columns: 1fr; }
    .info-grid .cell.span2, .info-grid .cell.span4 { grid-column: span 1; }
    .stat-row { grid-template-columns: 1fr; }
    .detail-top { flex-direction: column; }
    .detail-top .kv { grid-template-columns: 1fr; }
    table.tbl { font-size: 12px; }
}
