/* ============ 管理后台样式 ============ */
:root {
    --p: #1E7BF0;
    --bg: #f2f5fa;
    --card: #ffffff;
    --line: #e6ecf5;
    --text: #1b2637;
    --mut: #7b8798;
    --danger: #e5484d;
    --ok: #18a058;
    --radius: 12px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

b {
    font-weight: 600;
}

.muted {
    color: var(--mut);
    font-size: 13px;
}

.right {
    text-align: right;
}

/* ---------- 布局 ---------- */
.app {
    display: flex;
    min-height: 100vh;
}

.side {
    width: 222px;
    flex: 0 0 222px;
    background: #fff;
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 18px 14px;
}

.brand .logo {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    flex: 0 0 36px;
    box-shadow: 0 4px 12px rgba(30, 123, 240, .28);
}

.brand-t b {
    display: block;
    font-size: 13.5px;
    line-height: 1.3;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.brand-t span {
    font-size: 11.5px;
    color: #9aa6b6;
}

.nav {
    flex: 1;
    overflow-y: auto;
    padding: 4px 10px 20px;
}

.nav-g {
    margin-top: 14px;
}

.nav-g>i {
    display: block;
    font-style: normal;
    font-size: 11px;
    color: #a8b3c2;
    padding: 4px 8px 6px;
    letter-spacing: .5px;
}

.nav-i {
    display: block;
    padding: 8px 10px;
    border-radius: 8px;
    color: #46536a;
    font-size: 13.5px;
    margin-bottom: 2px;
    transition: .15s;
    position: relative;
}

.nav-i:hover {
    background: #f5f8fd;
    color: var(--text);
}

.nav-i.active {
    background: #eef4ff;
    color: var(--p);
    font-weight: 600;
}

.nav-i.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 10px;
    bottom: 10px;
    width: 3px;
    border-radius: 3px;
    background: var(--p);
}

.side-foot {
    border-top: 1px solid var(--line);
    padding: 12px 16px 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    font-size: 12.5px;
    color: var(--mut);
}

.side-foot .who {
    width: 100%;
    color: var(--text);
    font-weight: 600;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 2px;
}

.side-foot .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--ok);
}

.side-foot a:hover {
    color: var(--p);
}

.main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.top {
    height: 64px;
    background: rgba(255, 255, 255, .86);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 20;
}

.top-l h1 {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
}

.top-l p {
    margin: 2px 0 0;
    font-size: 12.5px;
    color: var(--mut);
}

.top-r {
    display: flex;
    gap: 10px;
    align-items: center;
}

.content {
    padding: 20px 24px 40px;
    max-width: 1240px;
    width: 100%;
}

/* ---------- 提示条 ---------- */
.alert {
    margin: 0 24px 16px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13.5px;
}

.alert.ok {
    background: #eaf9f1;
    color: #14804a;
    border: 1px solid #bfe9d3;
}

.alert.bad {
    background: #fdeeee;
    color: #b42322;
    border: 1px solid #f7cdcd;
}

.note {
    background: #f0f6ff;
    border: 1px solid #d6e6fd;
    color: #275b96;
    padding: 11px 14px;
    border-radius: 10px;
    font-size: 13px;
    margin-bottom: 16px;
    line-height: 1.7;
}

.note.warn {
    background: #fff8e8;
    border-color: #f7e2b5;
    color: #8a5b09;
}

.note code,
.kv code {
    background: rgba(0, 0, 0, .05);
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 12.5px;
}

/* ---------- 卡片 ---------- */
.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    margin-bottom: 16px;
    overflow: hidden;
}

.card-h {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--line);
}

.card-h h3 {
    margin: 0;
    font-size: 14.5px;
    font-weight: 600;
}

.card>.empty {
    padding: 34px;
    text-align: center;
    color: var(--mut);
}

/* ---------- 概览 ---------- */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.stat {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px 18px;
    transition: .18s;
}

.stat:hover {
    border-color: #c9dcf8;
    box-shadow: 0 6px 18px rgba(30, 90, 170, .07);
    transform: translateY(-1px);
}

.stat b {
    display: block;
    font-size: 24px;
    line-height: 1.2;
    color: var(--p);
    font-variant-numeric: tabular-nums;
}

.stat span {
    font-size: 12.5px;
    color: var(--mut);
}

.cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.quick {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 18px;
}

/* ---------- 工具栏 ---------- */
.bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.search {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.search input[type=search] {
    width: 220px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 13.5px;
    background: #fff;
    outline: none;
}

.search input[type=search]:focus {
    border-color: var(--p);
}

/* ---------- 表格 ---------- */
.tb {
    width: 100%;
    border-collapse: collapse;
}

.tb th {
    text-align: left;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--mut);
    background: #f8fafd;
    padding: 10px 14px;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

.tb td {
    padding: 11px 14px;
    border-bottom: 1px solid #f1f5fa;
    vertical-align: middle;
    font-size: 13.5px;
}

.tb tbody tr:hover {
    background: #fbfcfe;
}

.tb.mini td {
    padding: 9px 0;
    border-bottom: 1px dashed #f0f4f9;
}

.tb.mini td {
    padding: 9px 18px;
}

.tb.mini th {
    padding: 8px 18px;
}

.tb.mini tbody {
    display: table-row-group;
}

.tb .th-act {
    width: 120px;
    text-align: right;
}

.td-act {
    text-align: right;
    white-space: nowrap;
}

.tb .empty {
    text-align: center;
    color: var(--mut);
    padding: 40px 0;
}

.cell-strong {
    font-weight: 600;
    color: #16233a;
}

.num {
    font-variant-numeric: tabular-nums;
    color: #46536a;
}

.tb-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-top: 1px solid var(--line);
}

.inline {
    display: inline;
}

.lnk {
    color: var(--p);
    font-size: 13px;
    margin-left: 12px;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
}

.lnk:hover {
    text-decoration: underline;
}

.lnk.danger {
    color: var(--danger);
}

/* ---------- 缩略图 / 标签 ---------- */
.thumb {
    display: inline-block;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background: #eef2f8 center/cover no-repeat;
    border: 1px solid #e8eef7;
    vertical-align: middle;
}

.thumb.sm {
    width: 38px;
    height: 38px;
}

.thumb.contain {
    background-size: contain;
    background-color: #f7f9fc;
}

.thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 20px;
    font-size: 12px;
    line-height: 18px;
    background: #f1f5fa;
    color: #5a6b82;
}

.tag.on {
    background: #e9f8f0;
    color: #14804a;
}

.tag.off {
    background: #f4f5f7;
    color: #9099a8;
}

.tag.gray {
    background: #f1f5fa;
    color: #5a6b82;
}

/* ---------- 分页 ---------- */
.pager {
    display: flex;
    gap: 6px;
    align-items: center;
}

.pg {
    min-width: 30px;
    height: 30px;
    padding: 0 8px;
    border: 1px solid var(--line);
    border-radius: 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: #4c5a70;
    background: #fff;
}

.pg:hover {
    border-color: #c7dbf8;
}

.pg.active {
    background: var(--p);
    border-color: var(--p);
    color: #fff;
}

/* ---------- 按钮 ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 36px;
    padding: 0 16px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #fff;
    color: #33415c;
    font-size: 13.5px;
    cursor: pointer;
    font-family: inherit;
    transition: .15s;
    white-space: nowrap;
}

.btn:hover {
    border-color: #c7dbf8;
    color: var(--p);
}

.btn.primary {
    background: var(--p);
    border-color: var(--p);
    color: #fff;
    box-shadow: 0 4px 12px rgba(30, 123, 240, .22);
}

.btn.primary:hover {
    filter: brightness(1.05);
    color: #fff;
}

.btn.ghost {
    background: #f7f9fc;
}

.btn.sm {
    height: 32px;
    padding: 0 12px;
    font-size: 13px;
}

.btn.block {
    width: 100%;
    height: 42px;
    font-size: 14.5px;
}

/* ---------- 表单 ---------- */
.grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 16px 18px;
    padding: 18px;
}

.fld {
    min-width: 0;
}

.lb {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #33415c;
    margin-bottom: 7px;
}

.lb i,
i.req {
    color: var(--danger);
    font-style: normal;
    margin-left: 3px;
}

.ip,
.ta {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #dfe6f0;
    border-radius: 8px;
    font-size: 13.5px;
    font-family: inherit;
    color: var(--text);
    background: #fff;
    outline: none;
    transition: .15s;
}

.ip:focus,
.ta:focus {
    border-color: var(--p);
    box-shadow: 0 0 0 3px rgba(30, 123, 240, .1);
}

.ta {
    resize: vertical;
    line-height: 1.7;
    min-height: 80px;
}

.ta.font-mono,
textarea.font-mono {
    font-family: ui-monospace, Consolas, Monaco, monospace;
    font-size: 12.5px;
}

.ta-tools {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}

.ta-tip {
    font-size: 12px;
    color: var(--mut);
}

.hint {
    display: block;
    font-size: 12px;
    color: #97a3b5;
    font-style: normal;
    margin-top: 5px;
}

.ro {
    padding: 9px 12px;
    background: #f8fafd;
    border: 1px solid #eef2f8;
    border-radius: 8px;
    font-size: 13px;
    color: #4c5a70;
    min-height: 38px;
}

.ro-text {
    white-space: normal;
    line-height: 1.8;
    max-height: 220px;
    overflow: auto;
}

.color-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.color-row input[type=color] {
    width: 52px;
    height: 36px;
    padding: 2px;
    border: 1px solid #dfe6f0;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
}

/* 开关 */
.sw {
    display: inline-flex;
    align-items: center;
    padding-top: 4px;
}

.sw input[type=checkbox] {
    display: none;
}

.sw label {
    width: 42px;
    height: 24px;
    border-radius: 20px;
    background: #d8e0ec;
    position: relative;
    cursor: pointer;
    transition: .18s;
    display: block;
}

.sw label::after {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    top: 3px;
    left: 3px;
    transition: .18s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .18);
}

.sw input:checked+label {
    background: var(--p);
}

.sw input:checked+label::after {
    transform: translateX(18px);
}

/* 图片字段 */
.img-field {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.img-preview {
    width: 96px;
    height: 96px;
    border-radius: 10px;
    border: 1px dashed #d8e1ee;
    background: #f8fafd center/cover no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a9b5c6;
    font-size: 12px;
    flex: 0 0 96px;
    overflow: hidden;
}

.img-ops {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.img-path {
    font-size: 12px;
    color: #97a3b5;
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.imgs-field .thumb {
    position: relative;
    width: 76px;
    height: 76px;
    border-radius: 10px;
}

.imgs-field .thumb i {
    position: absolute;
    right: -6px;
    top: -6px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(20, 30, 50, .78);
    color: #fff;
    font-style: normal;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    line-height: 1;
}

.imgs-field .thumbs:empty {
    display: none;
}

.imgs-field {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* 图标字段 */
.icon-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.icon-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.icon-preview {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    border: 1px solid #e8eef7;
    background: #f8fafd;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 44px;
    overflow: hidden;
    font-size: 11px;
    color: #a9b5c6;
}

.icon-preview img {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

.icon-row .sel {
    width: 170px;
}

.form-foot {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-top: 1px solid var(--line);
    background: #fcfdff;
    border-radius: 0 0 var(--radius) var(--radius);
}

/* ---------- 分段 ---------- */
.seg {
    display: inline-flex;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 3px;
    gap: 2px;
}

.seg-i {
    padding: 7px 16px;
    border-radius: 7px;
    font-size: 13.5px;
    color: #4c5a70;
}

.seg-i.active {
    background: var(--p);
    color: #fff;
    font-weight: 600;
}

/* ---------- 键值 ---------- */
.kv {
    padding: 6px 18px 14px;
}

.kv>div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 0;
    border-bottom: 1px dashed #eef2f8;
    font-size: 13.5px;
}

.kv>div:last-child {
    border-bottom: 0;
}

.kv span {
    color: var(--mut);
}

/* ---------- 图片库 ---------- */
.up-form {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 18px;
    flex-wrap: wrap;
}

.up-form input[type=file] {
    font-size: 13px;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(138px, 1fr));
    gap: 14px;
    padding: 18px;
}

.g-item {
    margin: 0;
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    position: relative;
}

.g-img {
    display: block;
    height: 104px;
    background: #f2f5fa center/cover no-repeat;
}

.g-item figcaption {
    padding: 8px 10px;
    font-size: 12px;
    color: #46536a;
    display: flex;
    justify-content: space-between;
    gap: 6px;
}

.g-item figcaption em {
    font-style: normal;
    color: #a3aebf;
    flex: 0 0 auto;
}

.g-del {
    position: absolute;
    right: 6px;
    top: 6px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 0;
    background: rgba(15, 24, 40, .6);
    color: #fff;
    font-size: 15px;
    cursor: pointer;
    display: none;
    line-height: 1;
}

.g-item:hover .g-del {
    display: block;
}

/* ---------- 登录页 ---------- */
.login-body {
    background: #eff4fb;
    background-image: radial-gradient(1000px 500px at 15% 10%, #dbeafe 0%, transparent 60%),
        radial-gradient(900px 500px at 90% 90%, #e0f2fe 0%, transparent 60%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-wrap {
    width: 100%;
    max-width: 400px;
    padding: 24px;
}

.login-card {
    background: #fff;
    border-radius: 18px;
    padding: 34px 32px 26px;
    box-shadow: 0 20px 50px rgba(23, 55, 100, .12);
    text-align: center;
}

.login-logo {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    margin: 0 auto 14px;
    color: #fff;
    font-size: 22px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(30, 123, 240, .3);
}

.login-card h1 {
    font-size: 19px;
    margin: 0 0 4px;
}

.login-sub {
    color: var(--mut);
    font-size: 13px;
    margin: 0 0 20px;
}

.login-form {
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.login-form label span {
    display: block;
    font-size: 12.5px;
    color: #4c5a70;
    margin-bottom: 6px;
    font-weight: 600;
}

.login-form input {
    width: 100%;
    height: 42px;
    padding: 0 12px;
    border: 1px solid #dfe6f0;
    border-radius: 9px;
    font-size: 14px;
    outline: none;
    font-family: inherit;
}

.login-form input:focus {
    border-color: var(--p);
    box-shadow: 0 0 0 3px rgba(30, 123, 240, .1);
}

.login-form .btn {
    margin-top: 6px;
}

.login-tip {
    margin: 18px 0 0;
    font-size: 12px;
    color: #9aa6b6;
}

/* ---------- 响应式 ---------- */
@media (max-width: 1000px) {
    .cols {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 860px) {
    .side {
        display: none;
    }

    .content,
    .top {
        padding-left: 14px;
        padding-right: 14px;
    }

    .grid {
        grid-template-columns: repeat(6, 1fr);
    }

    .fld {
        grid-column: span 6 !important;
    }
}

/* ============ 上线配置：检查清单 ============ */
.bar-line {
    height: 8px;
    border-radius: 4px;
    background: #eef1f5;
    overflow: hidden;
    margin: 4px 0 8px;
}

.bar-line>i {
    display: block;
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--p), #23b4f0);
    transition: width .3s;
}

.ck {
    margin-top: 4px;
}

.ck-i {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 18px;
    border-top: 1px solid #f1f4f8;
}

.ck-dot {
    flex: none;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #f0a020;
    box-shadow: 0 0 0 3px rgba(240, 160, 32, .14);
}

.ck-dot.ok {
    background: var(--ok);
    box-shadow: 0 0 0 3px rgba(24, 160, 88, .14);
}

.ck-dot.manual {
    background: var(--p);
    box-shadow: 0 0 0 3px rgba(30, 123, 240, .14);
}

.ck-t {
    flex: 1;
    min-width: 0;
}

.ck-t>b {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.4;
}

.ck-t>em {
    display: block;
    margin-top: 3px;
    font-style: normal;
    font-size: 12.5px;
    line-height: 1.55;
    color: var(--mut);
}

.ck-tag {
    flex: none;
    padding: 2px 9px;
    border-radius: 10px;
    font-size: 12px;
    white-space: nowrap;
}

.ck-tag.ok {
    background: #e8f7ee;
    color: var(--ok);
}

.ck-tag.todo {
    background: #fdf3e3;
    color: #c07a12;
}

.ck-tag.manual {
    background: #e9f1fe;
    color: var(--p);
}

.ck-a {
    flex: none;
    font-size: 13px;
    color: var(--p);
    text-decoration: none;
    white-space: nowrap;
}

.ck-a:hover {
    text-decoration: underline;
}

@media (max-width: 720px) {
    .ck-i {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .ck-tag,
    .ck-a {
        margin-left: 21px;
    }
}

/* ============ 相册：批量上传 ============ */
.bulk-form {
    padding: 0 18px 16px;
}

.bulk .imgs-field {
    margin-top: 0;
}

.bulk .thumbs:empty::after {
    content: "还没有选择照片";
    display: block;
    padding: 26px 0;
    text-align: center;
    color: var(--mut);
    font-size: 13px;
}

.bulk-foot {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 16px;
}
