/* 管理后台样式(还原原型深蓝侧边栏风格) */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    background: #f0f3f8;
    color: #2b3a4d;
    min-height: 100vh;
}
a { text-decoration: none; color: inherit; }

/* ===== 布局 ===== */
.admin-wrap { display: flex; min-height: 100vh; }
.sidebar {
    width: 218px; background: #1f2a3a; color: #a9b8cc; flex-shrink: 0;
    display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.sidebar .logo {
    display: flex; align-items: center; gap: 10px; padding: 18px 20px;
    color: #fff; font-size: 16px; font-weight: 700;
    background: linear-gradient(135deg, #1f6feb, #3d8bff);
}
.sidebar .logo .logo-ic {
    width: 32px; height: 32px; border-radius: 8px; background: rgba(255, 255, 255, .2);
    display: flex; align-items: center; justify-content: center; font-size: 17px;
}
.sidebar nav { flex: 1; padding: 14px 10px; overflow-y: auto; }
.sidebar nav a {
    display: flex; align-items: center; gap: 10px; padding: 11px 14px;
    border-radius: 9px; font-size: 14px; margin-bottom: 4px; color: #a9b8cc;
    transition: .15s;
}
.sidebar nav a svg { width: 17px; height: 17px; fill: currentColor; flex-shrink: 0; }
.sidebar nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.sidebar nav a.on { background: linear-gradient(135deg, #1f6feb, #3d8bff); color: #fff; box-shadow: 0 4px 12px rgba(31, 111, 235, .35); }
.sidebar .side-foot { padding: 14px 20px; font-size: 11px; color: #5a6b80; border-top: 1px solid rgba(255, 255, 255, .06); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
    height: 58px; background: #fff; display: flex; align-items: center;
    padding: 0 22px; box-shadow: 0 1px 6px rgba(30, 60, 120, .08); z-index: 10;
}
.topbar .crumb { font-size: 14px; color: #5a6b80; }
.topbar .crumb b { color: #2b3a4d; }
.topbar .top-right { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.topbar .scan-link {
    display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: #2f7cf6;
    border: 1px solid #bcd6fb; padding: 6px 14px; border-radius: 16px;
}
.topbar .scan-link:hover { background: #eef5ff; }
.topbar .admin-info { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #46586c; }
.topbar .admin-info img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.topbar .logout { font-size: 13px; color: #8a97a8; }
.topbar .logout:hover { color: #f0506e; }

.content { padding: 20px 22px 40px; flex: 1; }

/* ===== 卡片与表格 ===== */
.card {
    background: #fff; border-radius: 12px; padding: 18px 20px;
    box-shadow: 0 2px 8px rgba(30, 60, 120, .05); margin-bottom: 18px;
}
.card-title { font-size: 16px; font-weight: 700; margin-bottom: 16px; display: flex; align-items: center; justify-content: space-between; }
.card-title .extra { font-size: 13px; font-weight: 400; color: #8a97a8; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-card {
    background: #fff; border-radius: 12px; padding: 18px;
    box-shadow: 0 2px 8px rgba(30, 60, 120, .05);
    display: flex; align-items: center; gap: 14px;
}
.stat-card .s-ic {
    width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
    font-size: 22px; color: #fff;
}
.stat-card .s-num { font-size: 24px; font-weight: 700; }
.stat-card .s-lbl { font-size: 12px; color: #8a97a8; margin-top: 2px; }
.bg-blue { background: linear-gradient(135deg, #1f6feb, #4a9fff); }
.bg-green { background: linear-gradient(135deg, #22b07d, #3ecf96); }
.bg-orange { background: linear-gradient(135deg, #ff8f1f, #ffb054); }
.bg-purple { background: linear-gradient(135deg, #7a5af5, #a58bff); }
.bg-red { background: linear-gradient(135deg, #f0506e, #ff7a90); }
.bg-cyan { background: linear-gradient(135deg, #12b5cb, #4dd7e8); }

.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th, .tbl td { padding: 11px 10px; border-bottom: 1px solid #f0f4f9; text-align: left; vertical-align: middle; }
.tbl th { background: #f7faff; color: #5a6b80; font-weight: 600; white-space: nowrap; }
.tbl tr:hover td { background: #fafcff; }
.tbl .cover-sm { width: 52px; height: 40px; object-fit: cover; border-radius: 6px; }
.tbl .num-c { text-align: center; }

.tag {
    display: inline-block; font-size: 12px; padding: 2px 9px; border-radius: 5px; line-height: 1.7; white-space: nowrap;
}
.tag-blue { background: #e8f1fe; color: #2f7cf6; }
.tag-green { background: #e3f8ef; color: #18a058; }
.tag-gray { background: #eef1f5; color: #8a97a8; }
.tag-red { background: #fdeef1; color: #f0506e; }
.tag-orange { background: #fff3e3; color: #ff8f1f; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 5px;
    height: 34px; padding: 0 14px; border-radius: 7px; font-size: 13px; cursor: pointer;
    border: 1px solid #dde4ec; background: #fff; color: #46586c; transition: .15s;
}
.btn:hover { border-color: #9db9e8; color: #2f7cf6; }
.btn-primary { background: linear-gradient(135deg, #1f6feb, #3d8bff); border: none; color: #fff; }
.btn-primary:hover { opacity: .9; color: #fff; }
.btn-danger { background: #f0506e; border: none; color: #fff; }
.btn-danger:hover { opacity: .9; color: #fff; }
.btn-green { background: #22b07d; border: none; color: #fff; }
.btn-green:hover { opacity: .9; color: #fff; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.link-btn { color: #2f7cf6; cursor: pointer; background: none; border: none; font-size: 13px; padding: 2px 6px; }
.link-btn:hover { text-decoration: underline; }
.link-btn.red { color: #f0506e; }
.link-btn.green { color: #18a058; }

/* 筛选行 */
.filter-row { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
.filter-row input, .filter-row select {
    height: 36px; border: 1px solid #dde4ec; border-radius: 8px; padding: 0 12px;
    font-size: 13px; outline: none; background: #fff;
}
.filter-row input { width: 220px; }
.filter-row input:focus, .filter-row select:focus { border-color: #2f7cf6; }
.filter-row .stat-inline { font-size: 13px; color: #5a6b80; margin-left: auto; }
.filter-row .stat-inline b { color: #2f7cf6; font-size: 16px; }

/* 分页 */
.pager { display: flex; gap: 6px; justify-content: flex-end; margin-top: 14px; }
.pager button {
    min-width: 32px; height: 32px; border: 1px solid #dde4ec; background: #fff;
    border-radius: 6px; font-size: 13px; cursor: pointer; color: #46586c;
}
.pager button.on { background: #2f7cf6; color: #fff; border-color: #2f7cf6; }

/* 表单 */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 18px; }
.form-item { margin-bottom: 2px; }
.form-item.full { grid-column: 1 / -1; }
.form-item label { display: block; font-size: 13px; color: #46586c; margin-bottom: 7px; font-weight: 600; }
.form-item label b { color: #f0506e; margin-right: 2px; }
.form-item input[type="text"], .form-item input[type="number"], .form-item input[type="date"],
.form-item input[type="password"], .form-item select, .form-item textarea {
    width: 100%; height: 38px; border: 1px solid #dde4ec; border-radius: 8px;
    padding: 0 12px; font-size: 13.5px; outline: none; background: #fff; font-family: inherit;
}
.form-item textarea { height: auto; padding: 10px 12px; resize: vertical; }
.form-item input:focus, .form-item select:focus, .form-item textarea:focus { border-color: #2f7cf6; box-shadow: 0 0 0 3px rgba(47, 124, 246, .1); }
.form-item .hint { font-size: 12px; color: #9aa5b1; margin-top: 5px; }

/* 开关 */
.switch { position: relative; display: inline-block; width: 46px; height: 24px; }
.switch input { display: none; }
.switch .slider {
    position: absolute; inset: 0; top: 0; left: 0; right: 0; bottom: 0;
    background: #d4dce6; border-radius: 24px; transition: .2s; cursor: pointer;
}
.switch .slider::before {
    content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%;
    background: #fff; top: 3px; left: 3px; transition: .2s; box-shadow: 0 2px 4px rgba(0, 0, 0, .2);
}
.switch input:checked + .slider { background: #2f7cf6; }
.switch input:checked + .slider::before { transform: translateX(22px); }
.switch-row { display: flex; align-items: center; gap: 10px; }
.switch-row .sw-lbl { font-size: 13.5px; color: #46586c; font-weight: 600; }
.switch-row .sw-hint { font-size: 12px; color: #9aa5b1; }

/* 组别编辑 */
.group-edit-row { display: grid; grid-template-columns: 2fr 1.2fr 1fr 1fr 60px; gap: 8px; margin-bottom: 8px; align-items: center; }
.group-edit-row input, .group-edit-row select {
    height: 36px; border: 1px solid #dde4ec; border-radius: 8px; padding: 0 10px; font-size: 13px; outline: none;
}
.group-edit-row .del-g {
    height: 36px; border: none; border-radius: 8px; background: #fdeef1; color: #f0506e; cursor: pointer; font-size: 15px;
}

/* 弹窗 */
.mask {
    position: fixed; inset: 0; top: 0; left: 0; right: 0; bottom: 0; z-index: 100;
    background: rgba(15, 25, 40, .5); display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal {
    background: #fff; border-radius: 14px; width: 100%; max-width: 860px;
    max-height: 88vh; display: flex; flex-direction: column;
    box-shadow: 0 24px 60px rgba(10, 25, 60, .3);
}
.modal .modal-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; border-bottom: 1px solid #f0f4f9; font-size: 16px; font-weight: 700;
}
.modal .modal-head .close { cursor: pointer; font-size: 20px; color: #9aa5b1; background: none; border: none; }
.modal .modal-body { padding: 18px 20px; overflow-y: auto; flex: 1; }
.modal .modal-foot { padding: 14px 20px; border-top: 1px solid #f0f4f9; display: flex; justify-content: flex-end; gap: 10px; }
.modal.modal-sm { max-width: 440px; }

/* UI 图片管理 */
.ui-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.ui-item { border: 1px solid #eef2f7; border-radius: 12px; overflow: hidden; }
.ui-item .ui-preview { height: 120px; background: #f4f6fa; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.ui-item .ui-preview img { max-width: 100%; max-height: 100%; object-fit: cover; }
.ui-item .ui-info { padding: 10px 12px; }
.ui-item .ui-name { font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.ui-item .ui-actions { display: flex; gap: 8px; }
.ui-item input[type="file"] { display: none; }

/* 登录页 */
.login-wrap {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #16264a 0%, #1f6feb 120%); padding: 20px;
}
.login-card {
    width: 100%; max-width: 400px; background: #fff; border-radius: 16px;
    padding: 36px 34px; box-shadow: 0 24px 64px rgba(8, 30, 80, .4);
}
.login-card .logo-row { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; justify-content: center; }
.login-card .logo-ic {
    width: 46px; height: 46px; border-radius: 12px; font-size: 24px;
    background: linear-gradient(135deg, #1f6feb, #3d8bff); color: #fff;
    display: flex; align-items: center; justify-content: center;
}
.login-card h1 { font-size: 19px; }
.login-card .sub { font-size: 12px; color: #8a97a8; margin-top: 3px; }
.login-card .form-item { margin-bottom: 16px; }
.login-card .login-btn {
    width: 100%; height: 44px; border: none; border-radius: 10px; font-size: 15px; font-weight: 600;
    background: linear-gradient(135deg, #1f6feb, #3d8bff); color: #fff; cursor: pointer;
    box-shadow: 0 8px 18px rgba(31, 111, 235, .35);
}
.login-card .err {
    background: #fdeef1; color: #d03050; font-size: 13px; border-radius: 8px;
    padding: 10px 14px; margin-bottom: 14px;
}
.login-links { text-align: center; margin-top: 18px; font-size: 12px; color: #9aa5b1; }
.login-links a { color: #2f7cf6; }

/* 桌面端 mini tab */
.mini-tabs { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.mini-tabs button {
    height: 34px; padding: 0 16px; border-radius: 17px; border: 1px solid #dde4ec;
    background: #fff; font-size: 13px; color: #46586c; cursor: pointer;
}
.mini-tabs button.on { background: #2f7cf6; color: #fff; border-color: #2f7cf6; }

@media (max-width: 900px) {
    .sidebar { width: 62px; }
    .sidebar .logo span, .sidebar nav a span, .sidebar .side-foot { display: none; }
    .sidebar nav a { justify-content: center; }
    .form-grid { grid-template-columns: 1fr; }
}
