:root {
    --ink: #12233F;
    --muted: #5C6B85;
    --line: #E6ECF6;
    --panel: #ffffff;
    --canvas: #F5F8FF;
    --brand: #146BFF;
    --brand-dark: #0B49B8;
    --blue: #146BFF;
    --amber: #F59E0B;
    --danger: #EF4444;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; color: var(--ink); background: var(--canvas); font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif; letter-spacing: 0; }
a { color: inherit; }
.layui-btn { border-radius: 4px; }
.layui-btn-normal { background-color: var(--blue); }
.layui-btn-danger { background-color: var(--danger); }
.layui-form-select dl dd.layui-this { background-color: var(--brand); }
.layui-table th { font-weight: 650; color: #5C6B85; background: #F4F8FF; }
.layui-table td, .layui-table th { font-size: 13px; }
.layui-input, .layui-select, .layui-textarea { border-radius: 4px; }
.layui-badge { height: 22px; line-height: 22px; padding: 0 8px; border-radius: 3px; }

.login-page { min-height: 100vh; display: grid; grid-template-columns: minmax(320px, 1.12fr) minmax(360px, .88fr); background: #F0F5FF; }
.login-brand { min-height: 100vh; padding: 72px; display: flex; flex-direction: column; justify-content: space-between; color: #fff; background: #0E1C3A; }
.login-mark { display: flex; align-items: center; gap: 14px; font-size: 20px; font-weight: 700; }
.login-mark-icon { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.28); border-radius: 6px; font-size: 24px; }
.login-brand h1 { max-width: 620px; margin: 0; font-size: 42px; line-height: 1.28; font-weight: 650; letter-spacing: 0; }
.login-brand p { max-width: 560px; margin: 18px 0 0; color: #A3B6D8; font-size: 16px; line-height: 1.8; }
.login-foot { color: #7E91B8; font-size: 13px; }
.login-panel { min-height: 100vh; display: grid; place-items: center; padding: 40px; }
.login-box { width: min(400px, 100%); background: #fff; padding: 38px; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 18px 50px rgba(18, 48, 110, .08); }
.login-box h2 { margin: 0 0 8px; font-size: 25px; font-weight: 650; }
.login-box .subtitle { margin: 0 0 28px; color: var(--muted); }
.login-box .layui-input { height: 46px; }
.login-box .layui-btn { height: 46px; font-size: 15px; background: var(--brand); }
.captcha-row { display: grid; grid-template-columns: minmax(0,1fr) 128px; gap: 10px; }
.captcha-row img { width: 128px; height: 44px; border: 1px solid var(--line); border-radius: 4px; cursor: pointer; }

.admin-shell { min-height: 100vh; }
.admin-sidebar { position: fixed; inset: 0 auto 0 0; width: 232px; color: #93A7CF; background: #0E1C3A; z-index: 20; }
.admin-logo { height: 68px; display: flex; align-items: center; gap: 12px; padding: 0 22px; border-bottom: 1px solid rgba(255,255,255,.08); font-weight: 700; font-size: 17px; }
.admin-logo i { color: #38A1FF; font-size: 23px; }
.admin-nav { height: calc(100vh - 68px); padding: 14px 12px 30px; overflow-y: auto; scrollbar-width: thin; }
.admin-nav-label { padding: 10px 12px 7px; color: #7E91B8; font-size: 11px; text-transform: uppercase; }
.admin-nav a { height: 44px; display: flex; align-items: center; gap: 12px; padding: 0 13px; margin-bottom: 4px; border-radius: 5px; color: #93A7CF; text-decoration: none; }
.admin-nav a i { width: 20px; text-align: center; font-size: 18px; }
.admin-nav a:hover, .admin-nav a.active { color: #fff; background: #146BFF; }
.admin-main { margin-left: 232px; min-height: 100vh; }
.admin-topbar { height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 0 26px; border-bottom: 1px solid var(--line); background: #fff; }
.admin-title-block { min-width: 0; }
.admin-title-block h1 { margin: 3px 0 0; font-size: 20px; line-height: 1.2; font-weight: 650; }
.admin-topbar-title { font-size: 12px; color: var(--muted); }
.admin-user { display: flex; align-items: center; gap: 12px; white-space: nowrap; }
.admin-avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--brand); }
.admin-logout { color: var(--muted); text-decoration: none; }
.admin-menu-toggle { display: none; width: 36px; height: 36px; border: 0; border-radius: 4px; background: #EAF1FF; color: var(--brand); cursor: pointer; }
.role-pill { padding: 3px 7px; border-radius: 4px; color: var(--brand-dark); background: #E6F0FF; font-size: 11px; }
.page { padding: 24px; }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 20px; }
.page-head h2 { margin: 0; font-size: 22px; font-weight: 650; }
.page-head p { margin: 7px 0 0; color: var(--muted); }
.toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.toolbar-left, .toolbar-right { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.toolbar .layui-input { width: 260px; }
/* —— 搜索/筛选下拉框:与输入框同高,自定义箭头,品牌蓝聚焦 —— */
.toolbar select {
    height: 38px;
    width: 170px;
    padding: 0 30px 0 12px;
    font-size: 13px;
    font-family: inherit;
    color: var(--ink);
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 16 16'%3E%3Cpath fill='%238A94A6' d='M4.646 6.146a.5.5 0 0 1 .708 0L8 8.793l2.646-2.647a.5.5 0 0 1 .708.708l-3 3a.5.5 0 0 1-.708 0l-3-3a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    border: 1px solid var(--line);
    border-radius: 6px;
    outline: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.toolbar select:hover { border-color: #B9CBEA; background-color: #FAFCFF; }
.toolbar select:focus { border-color: var(--brand); background-color: #fff; box-shadow: 0 0 0 3px rgba(20,107,255,.14); }
.toolbar select::-ms-expand { display: none; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; }
.panel-body { padding: 20px; }
.table-wrap { overflow-x: auto; }
.muted { color: var(--muted); }
.cell-note { margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.35; }
.image-cell { width: 58px; height: 42px; object-fit: cover; border-radius: 4px; border: 1px solid var(--line); background: #F0F5FF; }
.avatar-thumb { width: 36px; height: 36px; object-fit: cover; border-radius: 50%; }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card { min-height: 126px; padding: 20px; background: #fff; border: 1px solid var(--line); border-radius: 6px; }
.stat-card-head { display: flex; justify-content: space-between; align-items: center; color: var(--muted); }
.stat-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 6px; color: var(--brand); background: #E6F0FF; font-size: 20px; }
.stat-card:nth-child(2) .stat-icon { color: var(--blue); background: #E6F0FF; }
.stat-card:nth-child(3) .stat-icon { color: var(--amber); background: #FEF3E2; }
.stat-card:nth-child(4) .stat-icon { color: #7C4DFF; background: #F5F0FF; }
.stat-value { margin-top: 12px; font-size: 30px; font-weight: 700; }
.dashboard-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }

.form-page .layui-form-label { width: 116px; white-space: nowrap; }
.form-page .layui-input-block { margin-left: 146px; }
.form-actions { margin-top: 22px; padding-top: 18px; text-align: right; border-top: 1px solid var(--line); }
.form-panel { max-width: 1060px; }
.form-section-title { margin: 0 0 18px; font-size: 16px; font-weight: 650; }
.upload-box { display: grid; grid-template-columns: 160px minmax(0,1fr); gap: 14px; align-items: center; }
.upload-preview { width: 160px; height: 108px; object-fit: cover; border-radius: 5px; border: 1px solid var(--line); background: #F5F8FF; }
.upload-empty { width: 160px; height: 108px; display: grid; place-items: center; color: var(--muted); border: 1px dashed #C8D3E0; border-radius: 5px; background: #F8FAFF; }
.upload-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.upload-actions input[type=file] { max-width: 280px; }
.profile-grid { display: grid; grid-template-columns: 320px minmax(0,1fr); gap: 16px; }
.profile-card { text-align: center; }
.profile-avatar { width: 78px; height: 78px; margin: 6px auto 14px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--brand); font-size: 30px; font-weight: 700; }
.profile-meta { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 10px; }

@media (max-width: 900px) {
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-grid, .profile-grid { grid-template-columns: 1fr; }
    .login-page { grid-template-columns: 1fr; }
    .login-brand { display: none; }
}

@media (max-width: 640px) {
    .admin-sidebar { width: 232px; transform: translateX(-100%); transition: transform .2s ease; }
    body.nav-open .admin-sidebar { transform: translateX(0); box-shadow: 8px 0 30px rgba(0,0,0,.18); }
    .admin-main { margin-left: 0; }
    .admin-menu-toggle { display: grid; place-items: center; flex: 0 0 36px; }
    .admin-topbar { padding: 0 14px; gap: 10px; }
    .admin-user > span:not(.admin-avatar), .role-pill { display: none; }
    .page { padding: 16px; }
    .page-head { align-items: flex-start; flex-direction: column; }
    .toolbar { align-items: stretch; flex-direction: column; }
    .toolbar-left, .toolbar-right, .toolbar .layui-input, .toolbar .layui-btn, .toolbar select { width: 100%; }
    .stats-grid { grid-template-columns: 1fr; }
    .form-page .layui-form-label { width: auto; float: none; display: block; padding: 0 0 8px; text-align: left; }
    .form-page .layui-input-block { margin-left: 0; }
    .upload-box { grid-template-columns: 1fr; }
    .upload-preview, .upload-empty { width: 100%; height: 170px; }
    .captcha-row { grid-template-columns: minmax(0,1fr) 108px; }
    .captcha-row img { width: 108px; }
}

.picker-page { min-height: 100vh; background: #F5F8FF; }
.picker-shell { padding: 18px; }
.picker-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.picker-toolbar .toolbar-left, .picker-toolbar .toolbar-right { display: flex; align-items: center; gap: 10px; }
.picker-toolbar .layui-input { width: 260px; }
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(142px, 1fr)); gap: 14px; }
.file-card { overflow: hidden; position: relative; border: 1px solid var(--line); border-radius: 6px; background: #fff; cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease; }
.file-card:hover { border-color: var(--brand); box-shadow: 0 8px 22px rgba(20,107,255,.14); }
.file-thumb { aspect-ratio: 1 / .76; background: #F0F5FF center/cover no-repeat; }
.file-info { padding: 10px; }
.file-name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 13px; }
.file-meta { margin-top: 5px; color: var(--muted); font-size: 11px; }
.empty-state { grid-column: 1 / -1; padding: 70px 20px; text-align: center; color: var(--muted); background: #fff; border: 1px solid var(--line); border-radius: 6px; }
#pager { margin-top: 16px; text-align: center; }

@media (max-width: 640px) {
    .picker-toolbar { align-items: stretch; flex-direction: column; }
    .picker-toolbar .toolbar-left, .picker-toolbar .toolbar-right, .picker-toolbar .layui-input, .picker-toolbar .layui-btn { width: 100%; }
    .picker-toolbar input[type=file] { width: 100%; }
}
.file-card { display: block; width: 100%; padding: 0; text-align: left; font: inherit; color: inherit; }
.file-card .file-thumb, .file-card .file-info, .file-card .file-name, .file-card .file-meta { display: block; }

.modal-form-body { min-height: 100vh; background: #fff; }
.modal-form-body .modal-form-panel { max-width: none; min-height: 100vh; border: 0; border-radius: 0; }
.modal-form-body .panel-body { padding: 22px 24px; }
.modal-form-body .form-page { min-height: auto; }

.stat-link { display: block; color: inherit; text-decoration: none; }
.stat-link:hover { border-color: #C9D8E8; box-shadow: 0 12px 28px rgba(20,107,255,.12); transform: translateY(-1px); }
.stat-action { margin-top: 10px; color: var(--brand); font-size: 12px; font-weight: 600; }

.table-empty { height: 86px; text-align: center; color: var(--muted); background: #fff; }

.admin-user-button { display: inline-flex; align-items: center; gap: 12px; padding: 0; border: 0; background: transparent; color: inherit; cursor: pointer; }
.admin-user-button .admin-avatar { flex: 0 0 auto; }
.modal-profile-body .panel-body { padding: 24px; }

/* 统一 Layui 原生绿色为主色到蓝色 */
.layui-btn { background-color: var(--brand); }
.layui-btn:hover { background-color: #0E5AE0; }
.layui-form-checked[lay-skin="primary"] i { border-color: var(--brand); background-color: var(--brand); color: #fff; }
.layui-form-onswitch { border-color: var(--brand); background-color: var(--brand); }
.layui-form-radioed i, .layui-form-radio:hover i { color: var(--brand); }
.layui-laypage .layui-laypage-curr .layui-laypage-em { background-color: var(--brand); }
.layui-tab-brief > .layui-tab-title .layui-this { color: var(--brand); }
.layui-tab-brief > .layui-tab-title .layui-this:after { border-bottom: 2px solid var(--brand); }
.layui-breadcrumb a:hover { color: var(--brand); }
.layui-layer-btn .layui-layer-btn0 { border-color: var(--brand); background-color: var(--brand); }
