/* =====================================================================
   生物试剂行业门户 —— 后台样式（浅色）
   与前台共用一套主色，便于统一维护
   ===================================================================== */

:root {
    --pri:      #0f88c4;
    --pri-d:    #0b6c9e;
    --pri-l:    #e8f4fb;
    --bg:       #eef4f9;
    --card:     #ffffff;
    --text:     #1e3346;
    --text-2:   #5b7386;
    --muted:    #93a8b8;
    --line:     #dce8f2;
    --line-2:   #eaf2f8;
    --ok:       #12a06a;
    --ok-bg:    #e6f7f0;
    --warn:     #d98217;
    --warn-bg:  #fdf3e3;
    --danger:   #d9534f;
    --danger-bg:#fdecea;
    --radius:   10px;
    --shadow:   0 2px 10px rgba(16, 63, 89, .06);
    --shadow-2: 0 10px 34px rgba(16, 63, 89, .12);
    --side-w:   232px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body.adm-body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--pri); text-decoration: none; }
a:hover { color: var(--pri-d); }
code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; background: var(--line-2); padding: 1px 5px; border-radius: 4px; color: #34566f; }
.muted { color: var(--muted); }
.c-danger { color: var(--danger) !important; }
.c-num { font-variant-numeric: tabular-nums; }
.c-time { color: var(--text-2); font-size: 12.5px; white-space: nowrap; }
.c-cut { color: var(--text-2); }
.ok { color: var(--ok); font-style: normal; }
.warn { color: var(--warn); font-style: normal; }
.danger { color: var(--danger); font-style: normal; }

/* ============================== 按钮 ============================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 36px;
    padding: 0 16px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: var(--pri);
    color: #fff;
    font-size: 13.5px;
    font-family: inherit;
    cursor: pointer;
    transition: .16s;
    white-space: nowrap;
    vertical-align: middle;
}
.btn:hover { background: var(--pri-d); color: #fff; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--pri); color: #fff; }
.btn-primary:hover { background: var(--pri-d); }
.btn-line { background: #fff; border-color: var(--line); color: var(--text); }
.btn-line:hover { border-color: var(--pri); color: var(--pri); background: var(--pri-l); }
.btn-text { background: transparent; color: var(--text-2); }
.btn-text:hover { background: var(--line-2); color: var(--pri); }
.btn-sm { height: 30px; padding: 0 12px; font-size: 12.5px; }
.btn-xs { height: 26px; padding: 0 10px; font-size: 12px; border-radius: 6px; }
.btn-lg { height: 42px; padding: 0 26px; font-size: 15px; }
.btn-block { width: 100%; }

/* ============================== 布局 ============================== */
.adm-shell { display: flex; min-height: 100vh; }

.adm-side {
    width: var(--side-w);
    flex: 0 0 var(--side-w);
    background: #0f2f45;
    color: #cfe0ec;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; bottom: 0; left: 0;
    z-index: 60;
    overflow-y: auto;
}
.adm-side-head { padding: 16px 16px 12px; }
.adm-logo { display: flex; align-items: center; gap: 10px; color: #fff; }
.adm-logo:hover { color: #fff; }
.adm-logo-mark {
    width: 36px; height: 36px; flex: 0 0 36px;
    border-radius: 9px;
    background: linear-gradient(135deg, #17a2d8, #0d6f9f);
    color: #fff; font-weight: 800; font-size: 14px;
    display: flex; align-items: center; justify-content: center;
    letter-spacing: .5px;
}
.adm-logo-mark-lg { width: 54px; height: 54px; flex: 0 0 54px; font-size: 20px; border-radius: 14px; }
.adm-logo-txt { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.adm-logo-txt b { font-size: 14.5px; }
.adm-logo-txt i { font-style: normal; font-size: 11.5px; color: #7ba3bd; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.adm-nav { flex: 1; padding: 4px 10px 16px; }
.adm-nav-group { margin-bottom: 10px; }
.adm-nav-gtitle {
    margin: 10px 8px 6px;
    font-size: 11px;
    color: #6c93ad;
    letter-spacing: .6px;
}
.adm-nav-item {
    display: flex; align-items: center; gap: 9px;
    padding: 8px 10px;
    border-radius: 8px;
    color: #c3d7e5;
    font-size: 13.5px;
    transition: .15s;
}
.adm-nav-item:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.adm-nav-item.is-active { background: linear-gradient(90deg, #1288c0, #0c6d9d); color: #fff; font-weight: 600; box-shadow: 0 2px 8px rgba(0, 0, 0, .18); }
.adm-nav-ico { width: 20px; text-align: center; font-size: 14px; }
.adm-nav-txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.adm-side-foot { padding: 12px 16px 18px; border-top: 1px solid rgba(255, 255, 255, .08); }
.adm-side-foot-row { display: flex; justify-content: space-between; font-size: 12px; color: #7ba3bd; margin-bottom: 4px; }
.adm-side-foot-row b { color: #cfe0ec; font-weight: 600; }
.adm-side-foot-btn {
    display: block; margin-top: 8px; text-align: center;
    height: 32px; line-height: 32px; border-radius: 8px;
    background: rgba(255, 255, 255, .09); color: #dceaf4; font-size: 12.5px;
}
.adm-side-foot-btn:hover { background: rgba(255, 255, 255, .16); color: #fff; }

.adm-main {
    flex: 1;
    min-width: 0;
    margin-left: var(--side-w);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.adm-top {
    height: 56px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 40;
}
.adm-burger { display: none; border: 0; background: transparent; font-size: 20px; color: var(--text); cursor: pointer; padding: 0 4px; }
.adm-top-title { font-size: 15px; font-weight: 600; }
.adm-top-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.adm-top-link { font-size: 13px; color: var(--text-2); }
.adm-top-link:hover { color: var(--pri); }
.adm-top-out { color: var(--danger); }
.adm-top-user { display: flex; align-items: center; gap: 8px; padding-left: 14px; border-left: 1px solid var(--line); }
.adm-ava {
    width: 32px; height: 32px; flex: 0 0 32px; border-radius: 50%;
    background: linear-gradient(135deg, #17a2d8, #0d6f9f);
    color: #fff; font-weight: 700; font-size: 13px;
    display: flex; align-items: center; justify-content: center;
}
.adm-top-uname { display: flex; flex-direction: column; line-height: 1.25; font-size: 13px; }
.adm-top-uname i { font-style: normal; font-size: 11px; color: var(--muted); }

.adm-content { flex: 1; padding: 20px; }
.adm-foot {
    padding: 16px 20px 26px;
    display: flex; gap: 12px; flex-wrap: wrap;
    color: var(--muted); font-size: 12.5px;
    border-top: 1px solid var(--line);
}
.adm-foot-r { margin-left: auto; }

/* ============================== 提示条 ============================== */
.adm-alert {
    display: flex; gap: 9px; align-items: flex-start;
    padding: 11px 14px;
    border-radius: var(--radius);
    margin-bottom: 14px;
    font-size: 13.5px;
    border: 1px solid transparent;
}
.adm-alert-ico { font-weight: 700; line-height: 1.5; }
.adm-alert-ok    { background: var(--ok-bg);     border-color: #b8e7d3; color: #0c7b52; }
.adm-alert-warn  { background: var(--warn-bg);   border-color: #f2ddb8; color: #98600f; }
.adm-alert-error { background: var(--danger-bg); border-color: #f4c9c6; color: #a5372f; }

.adm-note {
    background: #fff; border: 1px dashed var(--line);
    border-radius: var(--radius); padding: 12px 16px; margin-bottom: 16px;
    font-size: 13px; color: var(--text-2);
}
.adm-note b { color: var(--text); }

/* ============================== 页头 ============================== */
.adm-page { max-width: 1560px; }
.adm-page-head {
    display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap;
    margin-bottom: 16px;
}
.adm-ph-l h1 { margin: 0; font-size: 21px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.adm-ph-desc { margin: 5px 0 0; color: var(--text-2); font-size: 13px; }
.adm-ph-r { margin-left: auto; display: flex; gap: 9px; flex-wrap: wrap; }
.adm-cnt {
    background: var(--pri-l); color: var(--pri-d);
    font-size: 12.5px; font-weight: 600;
    padding: 2px 10px; border-radius: 20px;
}

/* ============================== 待处理 ============================== */
.adm-todo {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    background: #fff; border: 1px solid var(--line);
    border-radius: var(--radius); padding: 11px 16px; margin-bottom: 16px;
    box-shadow: var(--shadow);
}
.adm-todo-title { font-weight: 700; font-size: 13px; color: var(--text-2); }
.adm-todo-item {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 13px; border-radius: 20px; font-size: 13px;
    background: var(--pri-l); color: var(--pri-d);
}
.adm-todo-item b { font-size: 15px; }
.adm-todo-item i { font-style: normal; opacity: .6; }
.adm-todo-warn { background: var(--warn-bg); color: #98600f; }
.adm-todo-info { background: var(--pri-l); color: var(--pri-d); }

/* ============================== 指标卡 ============================== */
.adm-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(196px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}
.adm-stats-sm { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.adm-stat {
    background: #fff; border: 1px solid var(--line);
    border-radius: var(--radius); padding: 14px 16px;
    display: flex; align-items: center; gap: 12px;
    box-shadow: var(--shadow); transition: .16s;
}
.adm-stat:not(.is-static):hover { transform: translateY(-2px); box-shadow: var(--shadow-2); border-color: #c8e2f2; }
.adm-stat.is-static { cursor: default; }
.adm-stat-ico {
    width: 42px; height: 42px; flex: 0 0 42px;
    border-radius: 11px; background: var(--pri-l);
    display: flex; align-items: center; justify-content: center; font-size: 20px;
}
.adm-stat-body { display: flex; flex-direction: column; min-width: 0; }
.adm-stat-body b { font-size: 22px; font-weight: 700; line-height: 1.15; color: var(--text); }
.adm-stat-body .adm-stat-txt { font-size: 15px; }
.adm-stat-body i { font-style: normal; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ============================== 卡片 ============================== */
.adm-card {
    background: var(--card); border: 1px solid var(--line);
    border-radius: 12px; padding: 16px 18px 18px;
    box-shadow: var(--shadow); margin-bottom: 16px;
}
.adm-card-head {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    margin: -2px 0 14px; padding-bottom: 12px;
    border-bottom: 1px solid var(--line-2);
}
.adm-card-head h3 { margin: 0; font-size: 15px; font-weight: 700; }
.adm-card-tip { font-size: 12.5px; color: var(--muted); }
.adm-card-more { margin-left: auto; font-size: 13px; }
.adm-card-cnt { margin-left: auto; font-size: 12.5px; color: var(--muted); }

.adm-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 1200px) { .adm-grid2 { grid-template-columns: 1fr; } }

/* ============================== 图表 ============================== */
.adm-chart { display: flex; align-items: flex-end; gap: 8px; height: 168px; padding: 6px 2px 0; }
.adm-chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; }
.adm-chart-bars { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 3px; }
.cb { width: 9px; border-radius: 3px 3px 0 0; display: block; transition: .3s; }
.cb-1 { background: #4ab3e6; }
.cb-2 { background: #0f88c4; }
.cb-3 { background: #7fd0b0; }
.adm-chart-x { font-size: 11.5px; color: var(--muted); }
.adm-legend { display: flex; gap: 18px; margin-top: 10px; font-size: 12.5px; color: var(--text-2); }
.adm-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; }
.lg-1 { background: #4ab3e6; } .lg-2 { background: #0f88c4; } .lg-3 { background: #7fd0b0; }

/* ============================== 快捷操作 ============================== */
.adm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.adm-action {
    border: 1px solid var(--line); border-radius: 9px;
    padding: 12px 14px; display: flex; flex-direction: column; gap: 3px;
    transition: .16s; background: #fcfdff;
}
.adm-action:hover { border-color: #b8dcef; background: var(--pri-l); }
.adm-action b { font-size: 13.5px; color: var(--text); }
.adm-action i { font-style: normal; font-size: 12px; color: var(--muted); }

/* ============================== 系统列表 ============================== */
.adm-syslist { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 8px 22px; }
.adm-syslist > div { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; padding: 6px 0; border-bottom: 1px dashed var(--line-2); }
.adm-syslist span { color: var(--text-2); }
.adm-syslist b { font-weight: 600; text-align: right; }

/* ============================== 筛选条 ============================== */
.adm-filter {
    display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
    background: #fff; border: 1px solid var(--line);
    border-radius: var(--radius); padding: 12px 14px; margin-bottom: 12px;
    box-shadow: var(--shadow);
}
.adm-input {
    height: 34px; padding: 0 11px;
    border: 1px solid var(--line); border-radius: 8px;
    background: #fff; color: var(--text);
    font-size: 13.5px; font-family: inherit; outline: none;
    transition: .15s; min-width: 130px;
}
.adm-input:focus { border-color: var(--pri); box-shadow: 0 0 0 3px rgba(15, 136, 196, .12); }
.adm-input-sm { height: 30px; font-size: 12.5px; min-width: 116px; }
.adm-search { min-width: 240px; flex: 0 1 300px; }
.adm-filter-info { margin-left: auto; font-size: 13px; color: var(--text-2); }
.adm-filter-info b { color: var(--pri-d); font-size: 15px; }

/* ============================== 批量条 ============================== */
.adm-bulk-bar {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    background: #fbfdff; border: 1px solid var(--line);
    border-bottom: 0; border-radius: var(--radius) var(--radius) 0 0;
    padding: 10px 14px; font-size: 13px;
}
.adm-bulk-tip { color: var(--text-2); }
.adm-bulk-tip b { color: var(--pri-d); font-size: 15px; }
.adm-bulk-sp { flex: 1; }
.adm-check-inline { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 13px; color: var(--text-2); }
.adm-check-inline input { width: 15px; height: 15px; accent-color: var(--pri); }

/* ============================== 表格 ============================== */
.adm-tablewrap {
    background: #fff; border: 1px solid var(--line);
    border-radius: 0 0 var(--radius) var(--radius);
    overflow-x: auto;
}
.adm-card .adm-tablewrap { border-radius: var(--radius); }
.adm-table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 720px; }
.adm-table thead th {
    background: #f6fafd; color: var(--text-2);
    font-weight: 600; font-size: 12.5px; text-align: left;
    padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.adm-table tbody td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.adm-table tbody tr:hover { background: #f9fcfe; }
.adm-table tbody tr:last-child td { border-bottom: 0; }
.adm-table-mini { min-width: 0; font-size: 13px; }
.adm-table-mini tbody td { padding: 8px 10px; }
.adm-table .c-ck { width: 38px; text-align: center; }
.adm-table .c-ck input { width: 15px; height: 15px; accent-color: var(--pri); }
.adm-table .c-id { width: 62px; color: var(--muted); font-size: 12.5px; }
.adm-table .c-act { width: 168px; white-space: nowrap; }
.adm-table .c-act a { margin-right: 10px; font-size: 13px; }
.adm-table .c-act a:last-child { margin-right: 0; }
.adm-empty { text-align: center; color: var(--muted); padding: 42px 12px !important; }
.th-sort { color: var(--text-2); font-weight: 600; }
.th-sort:hover { color: var(--pri); }
.th-sort.is-on { color: var(--pri-d); }
.tree-indent { color: var(--muted); }
.cell-thumb {
    width: 38px; height: 38px; object-fit: cover;
    border-radius: 7px; border: 1px solid var(--line);
    margin-right: 3px; vertical-align: middle; background: #f6fafd;
}

/* ============================== 标签 ============================== */
.tag-mini {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 20px;
    font-size: 12px;
    line-height: 1.7;
    white-space: nowrap;
    margin-right: 3px;
}
.tag-on    { background: var(--ok-bg); color: #0c7b52; }
.tag-off   { background: #eef2f5; color: #8598a6; }
.tag-warn  { background: var(--warn-bg); color: #98600f; }
.tag-plain { background: var(--pri-l); color: var(--pri-d); }
a.tag-mini:hover { filter: brightness(.95); }

/* 前台状态徽标（后台复用 present.php 的 badge 辅助函数，这里补齐样式） */
.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 12px;
    line-height: 1.75;
    white-space: nowrap;
    background: var(--pri-l);
    color: var(--pri-d);
}
.badge-gray { background: #eef2f5; color: #7d909e; }
.badge-teal { background: var(--ok-bg); color: #0c7b52; }
.badge-warn { background: var(--warn-bg); color: #98600f; }
.badge-red  { background: var(--danger-bg); color: #a5372f; }

/* ============================== 分页 ============================== */
.adm-pager { margin-top: 14px; }
.adm-pager .pager { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; }
.adm-pager .pg {
    min-width: 32px; height: 32px; padding: 0 10px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--text-2);
}
.adm-pager .pg:hover { border-color: var(--pri); color: var(--pri); }
.adm-pager .pg.current { background: var(--pri); border-color: var(--pri); color: #fff; font-weight: 600; }
.adm-pager .pg-total { color: var(--muted); margin-right: 8px; }
.adm-pager .pg-dot { color: var(--muted); }

/* ============================== 弹窗 ============================== */
.adm-modal {
    position: fixed; inset: 0; z-index: 200;
    background: rgba(14, 42, 61, .45);
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}
.adm-modal[hidden] { display: none; }
.adm-modal-box {
    background: #fff; border-radius: 14px; width: 100%; max-width: 560px;
    max-height: 88vh; overflow: auto; box-shadow: var(--shadow-2);
}
.adm-modal-lg { max-width: 900px; }
.adm-modal-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 15px 18px; border-bottom: 1px solid var(--line-2);
}
.adm-modal-head h3 { margin: 0; font-size: 15.5px; }
.adm-modal-x { font-size: 22px; color: var(--muted); line-height: 1; }
.adm-modal-x:hover { color: var(--danger); }
.adm-modal-body { padding: 16px 18px; }
.adm-modal-foot {
    padding: 13px 18px; border-top: 1px solid var(--line-2);
    display: flex; justify-content: flex-end; gap: 10px;
}

/* ============================== 表单 ============================== */
.adm-form { margin: 0; }
.adm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(258px, 1fr)); gap: 4px 22px; align-items: start; }
.fw-col { min-width: 0; }
.fw-col-wide { grid-column: 1 / -1; min-width: 0; }
.fw-row { padding: 9px 0; min-width: 0; }
.fw-row-hidden { display: none; }
.fw-label {
    display: block; margin-bottom: 6px;
    font-size: 13px; font-weight: 600; color: #35566f;
}
.fw-req { color: var(--danger); font-style: normal; margin-left: 3px; }
.fw-ctrl { position: relative; min-width: 0; }
.fw-tip { margin: 5px 0 0; font-size: 12px; color: var(--muted); line-height: 1.55; }
.fw-tip a { text-decoration: underline; }

.fw-input {
    width: 100%; height: 38px; padding: 0 12px;
    border: 1px solid var(--line); border-radius: 8px;
    background: #fff; color: var(--text);
    font-size: 13.5px; font-family: inherit; outline: none;
    transition: .15s;
}
.fw-input:focus { border-color: var(--pri); box-shadow: 0 0 0 3px rgba(15, 136, 196, .12); }
.fw-input[readonly] { background: #f6fafd; color: var(--text-2); }
.fw-input::placeholder { color: #b3c4d0; }
select.fw-input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #90a7b7 50%), linear-gradient(135deg, #90a7b7 50%, transparent 50%); background-position: calc(100% - 16px) 16px, calc(100% - 11px) 16px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
.fw-area { height: auto; padding: 10px 12px; line-height: 1.65; resize: vertical; }
.fw-code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; }
.fw-num { font-variant-numeric: tabular-nums; }
.fw-price { position: relative; }
.fw-price-sym {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    color: var(--muted); font-size: 13px;
}
.fw-price .fw-input { padding-left: 28px; }

/* 开关 */
.fw-switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; }
.fw-switch-input { position: absolute; opacity: 0; width: 0; height: 0; }
.fw-switch-track {
    width: 44px; height: 24px; flex: 0 0 44px;
    border-radius: 20px; background: #cddae4; position: relative; transition: .2s;
}
.fw-switch-track i {
    position: absolute; top: 3px; left: 3px;
    width: 18px; height: 18px; border-radius: 50%;
    background: #fff; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.fw-switch-input:checked + .fw-switch-track { background: var(--ok); }
.fw-switch-input:checked + .fw-switch-track i { left: 23px; }
.fw-switch-text { font-size: 13px; color: var(--text-2); }
.fw-switch-mini .fw-switch-track { width: 36px; height: 20px; flex-basis: 36px; }
.fw-switch-mini .fw-switch-track i { width: 14px; height: 14px; top: 3px; left: 3px; }
.fw-switch-mini .fw-switch-input:checked + .fw-switch-track i { left: 19px; }

/* 单选 / 多选 */
.fw-radio-group, .fw-check-group { display: flex; flex-wrap: wrap; gap: 8px 14px; padding-top: 7px; }
.fw-radio, .fw-check {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 13.5px; cursor: pointer; color: var(--text);
}
.fw-radio input, .fw-check input { width: 15px; height: 15px; accent-color: var(--pri); }

/* 上传 / 媒体 */
.fw-media { min-width: 0; }
.fw-inline-btns { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.fw-inline-btns label.btn { position: relative; }
.fw-upload-msg { font-size: 12px; color: var(--muted); }
.fw-upload-msg.is-ok { color: var(--ok); }
.fw-upload-msg.is-err { color: var(--danger); }
.fw-preview { margin-top: 10px; }
.fw-preview:empty { display: none; }
.fw-preview img {
    max-width: 190px; max-height: 130px; border-radius: 8px;
    border: 1px solid var(--line); object-fit: contain; background: #f8fbfd;
}
.fw-preview-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.fw-preview-grid img { width: 82px; height: 82px; object-fit: cover; margin: 0; }
.fw-preview-grid .fw-img-wrap { position: relative; }
.fw-img-wrap button {
    position: absolute; top: -6px; right: -6px;
    width: 20px; height: 20px; border-radius: 50%;
    border: 0; background: var(--danger); color: #fff;
    font-size: 12px; line-height: 1; cursor: pointer; padding: 0;
}
.fw-tag-preview { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.fw-trans-bar { display: flex; align-items: center; gap: 10px; margin: -4px 0 4px; }

/* 富文本编辑器 */
.fw-editor { border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: #fff; }
.fw-editor-bar {
    display: flex; align-items: center; gap: 2px; flex-wrap: wrap;
    padding: 6px 8px; background: #f6fafd; border-bottom: 1px solid var(--line);
}
.fw-ebtn {
    min-width: 28px; height: 26px; padding: 0 6px;
    border: 0; border-radius: 5px; background: transparent;
    color: #4a6b83; font-size: 12.5px; font-family: inherit; cursor: pointer;
}
.fw-ebtn:hover { background: var(--pri-l); color: var(--pri-d); }
.fw-editor-sp { flex: 1; }
.fw-editor .fw-editor-src {
    border: 0; border-radius: 0; min-height: 240px;
    font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px;
}
.fw-editor .fw-editor-src:focus { box-shadow: none; }
.fw-editor-preview {
    padding: 14px 16px; line-height: 1.8; font-size: 14px;
    max-height: 460px; overflow: auto; background: #fff;
}
.fw-editor-preview h3 { font-size: 16px; margin: 16px 0 8px; }
.fw-editor-preview img { max-width: 100%; }
.fw-editor-preview table { border-collapse: collapse; width: 100%; }
.fw-editor-preview td, .fw-editor-preview th { border: 1px solid var(--line); padding: 8px 10px; }

/* 保存条 */
.adm-savebar {
    position: sticky; bottom: 0; z-index: 30;
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(6px);
    border: 1px solid var(--line); border-radius: 12px;
    padding: 13px 18px; margin-bottom: 16px;
    box-shadow: 0 -2px 14px rgba(16, 63, 89, .07);
}
.adm-savebar-msg { font-size: 13px; }
.adm-savebar-msg.is-ok { color: var(--ok); }
.adm-savebar-msg.is-err { color: var(--danger); }

.adm-subtitle {
    font-size: 12.5px; color: var(--muted);
    border-bottom: 1px dashed var(--line); padding: 10px 0 5px; margin-bottom: 2px;
}
.adm-testbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 0 4px; }
.adm-test-msg { font-size: 12.5px; color: var(--text-2); }
.adm-test-msg.is-ok { color: var(--ok); }
.adm-test-msg.is-err { color: var(--danger); }
.adm-btnrow { display: inline-block; margin: 0 8px 8px 0; }

/* ============================== 标签页 ============================== */
.adm-tabs {
    display: flex; gap: 4px; flex-wrap: wrap;
    border-bottom: 1px solid var(--line); margin-bottom: 16px;
}
.adm-tab {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 9px 16px; border: 0; background: transparent;
    border-bottom: 2px solid transparent; margin-bottom: -1px;
    font-size: 14px; font-family: inherit; color: var(--text-2); cursor: pointer;
}
.adm-tab:hover { color: var(--pri); }
.adm-tab.is-active { color: var(--pri-d); font-weight: 600; border-bottom-color: var(--pri); }
.adm-tabpanel[hidden] { display: none; }

/* ============================== 模块折叠 ============================== */
.adm-modlist { display: flex; flex-direction: column; }
.adm-mod { padding: 0; overflow: hidden; }
.adm-mod-head {
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
    cursor: pointer; padding: 14px 18px; background: #fbfdff;
    list-style: none;
}
.adm-mod-head::-webkit-details-marker { display: none; }
.adm-mod-head:hover { background: var(--pri-l); }
.adm-mod-name { font-size: 14.5px; font-weight: 600; }
.adm-mod-key { font-style: normal; font-size: 11.5px; color: var(--muted); background: #eef3f7; padding: 1px 8px; border-radius: 20px; margin-left: 6px; font-weight: 500; }
.adm-mod-meta { font-size: 12.5px; color: var(--muted); }
.adm-mod-sw { margin-left: auto; }
.adm-mod-body { padding: 4px 18px 18px; border-top: 1px solid var(--line-2); }

.adm-blockgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px 14px; padding-top: 8px; }
.adm-blockpick {
    display: inline-flex; align-items: center; gap: 7px;
    font-size: 13px; cursor: pointer; padding: 6px 10px;
    border: 1px solid var(--line); border-radius: 8px; background: #fcfdff;
}
.adm-blockpick:hover { border-color: var(--pri); background: var(--pri-l); }
.adm-blockpick input { width: 15px; height: 15px; accent-color: var(--pri); }

/* ============================== 结果面板 ============================== */
.adm-result { border-color: #b8dcef; background: #fbfdff; }
.adm-result-msg { font-size: 13.5px; margin: 0 0 10px; color: var(--text); }
.adm-result-msg b { color: var(--pri-d); font-size: 16px; }
.adm-result-list { margin: 0 0 10px; padding-left: 18px; }
.adm-result-list li { margin-bottom: 6px; font-size: 13.5px; display: flex; gap: 12px; flex-wrap: wrap; }
.adm-result-front { font-size: 12.5px; color: var(--muted); }

/* ============================== 动作胶囊 ============================== */
.adm-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 12px; }
.adm-chip {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 4px 12px; border-radius: 20px;
    background: #fff; border: 1px solid var(--line);
    font-size: 12.5px; color: var(--text-2);
}
.adm-chip:hover { border-color: var(--pri); color: var(--pri); }
.adm-chip b { color: var(--pri-d); }

/* ============================== 图库 ============================== */
.adm-mediagrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; max-height: 60vh; overflow: auto; }
.adm-mediaitem {
    border: 1px solid var(--line); border-radius: 9px; overflow: hidden;
    cursor: pointer; background: #f8fbfd; transition: .15s;
}
.adm-mediaitem:hover { border-color: var(--pri); box-shadow: 0 2px 10px rgba(15,136,196,.18); }
.adm-mediaitem img { width: 100%; height: 92px; object-fit: cover; display: block; }
.adm-mediaitem span { display: block; padding: 5px 7px; font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-mediagrid .adm-empty { grid-column: 1 / -1; }

/* ============================== Toast ============================== */
.adm-toast-wrap {
    position: fixed; right: 20px; bottom: 20px; z-index: 400;
    display: flex; flex-direction: column; gap: 8px; align-items: flex-end;
    pointer-events: none;
}
.adm-toast {
    background: #16374f; color: #fff;
    padding: 10px 16px; border-radius: 9px;
    font-size: 13.5px; max-width: 380px;
    box-shadow: var(--shadow-2);
    animation: admToastIn .22s ease;
}
.adm-toast.is-ok { background: #12855c; }
.adm-toast.is-err { background: #b23f39; }
@keyframes admToastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ============================== 登录页 ============================== */
body.adm-login-body {
    min-height: 100vh;
    background: linear-gradient(135deg, #0d2c42 0%, #11405e 45%, #0f6a97 100%);
    display: flex; align-items: center; justify-content: center;
    padding: 26px;
}
.adm-login {
    display: flex; width: 100%; max-width: 900px;
    background: #fff; border-radius: 18px; overflow: hidden;
    box-shadow: 0 22px 60px rgba(6, 30, 46, .35);
}
.adm-login-left {
    flex: 1 1 46%; padding: 40px 38px;
    background: linear-gradient(160deg, #10425f, #0b2c42);
    color: #d6e6f1; display: flex; flex-direction: column;
}
.adm-login-brand { display: flex; flex-direction: column; gap: 12px; margin-bottom: 26px; }
.adm-login-brand h1 { margin: 0; font-size: 21px; color: #fff; }
.adm-login-brand p { margin: 0; font-size: 13px; color: #8fb6cd; }
.adm-login-feat { list-style: none; margin: 0; padding: 0; flex: 1; }
.adm-login-feat li { font-size: 13px; padding: 7px 0; border-bottom: 1px dashed rgba(255,255,255,.12); color: #b6d0e0; }
.adm-login-feat li b { color: #fff; margin-right: 6px; }
.adm-login-ver { margin: 20px 0 0; font-size: 12px; color: #7599b0; }

.adm-login-right { flex: 1 1 54%; padding: 44px 42px; display: flex; align-items: center; }
.adm-login-form { width: 100%; }
.adm-login-form h2 { margin: 0 0 6px; font-size: 22px; }
.adm-login-sub { margin: 0 0 22px; font-size: 13px; color: var(--muted); }
.adm-login-field { display: block; margin-bottom: 16px; }
.adm-login-field > span { display: block; font-size: 13px; font-weight: 600; color: #35566f; margin-bottom: 7px; }
.adm-login-field input {
    width: 100%; height: 44px; padding: 0 14px;
    border: 1px solid var(--line); border-radius: 9px;
    font-size: 14.5px; font-family: inherit; outline: none; transition: .15s;
}
.adm-login-field input:focus { border-color: var(--pri); box-shadow: 0 0 0 3px rgba(15,136,196,.14); }
.adm-login-form .btn-block { margin-top: 8px; }
.adm-login-foot { display: flex; justify-content: space-between; margin-top: 18px; font-size: 13px; }
.adm-login-tip { margin: 18px 0 0; font-size: 12px; color: var(--muted); line-height: 1.6; }

/* ============================== 响应式 ============================== */
@media (max-width: 1000px) {
    .adm-side { transform: translateX(-100%); transition: .24s; }
    body.adm-side-open .adm-side { transform: none; }
    body.adm-side-open::after {
        content: ''; position: fixed; inset: 0; background: rgba(10, 32, 48, .42); z-index: 55;
    }
    .adm-main { margin-left: 0; }
    .adm-burger { display: block; }
    .adm-content { padding: 14px; }
    .adm-actions { grid-template-columns: 1fr; }
    .adm-login { flex-direction: column; max-width: 440px; }
    .adm-login-left { display: none; }
    .adm-login-right { padding: 32px 26px; }
    .adm-search { min-width: 150px; flex: 1 1 100%; }
    .adm-top-uname { display: none; }
}
@media (max-width: 640px) {
    .adm-page-head { align-items: flex-start; }
    .adm-ph-r { width: 100%; margin-left: 0; }
    .adm-ph-l h1 { font-size: 18px; }
    .adm-stats { grid-template-columns: 1fr 1fr; }
    .adm-grid { grid-template-columns: 1fr; }
    .adm-savebar { padding: 11px 13px; gap: 8px; }
    .adm-savebar .btn-lg { height: 38px; font-size: 14px; padding: 0 18px; }
    .adm-content { padding: 11px; }
    .adm-card { padding: 13px 13px 15px; border-radius: 10px; }
    .fw-preview img { max-width: 100%; }
    .adm-chart { height: 132px; }
}
