/* ===== 管理端基础样式（现代简洁版） ===== */
:root {
    --primary: #2f6bff;
    --primary-2: #5b8def;
    --primary-grad: linear-gradient(135deg, #2f6bff 0%, #5b8def 100%);
    --sidebar-bg: #1f2937;
    --sidebar-bg-2: #111827;
    --text: #1f2733;
    --text-2: #6b7785;
    --bg: #eef2f8;
    --card: #ffffff;
    --border: #eaeef5;
    --success: #2bbf6a;
    --warning: #ff9f2e;
    --danger: #ff5b6e;
    --radius: 14px;
    --shadow: 0 6px 22px rgba(31, 45, 80, 0.08);
    --shadow-hover: 0 10px 30px rgba(31, 45, 80, 0.12);
}
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.6;
}

/* ===== 登录页 ===== */
body.login-bg {
    background-size: cover; background-position: center; background-repeat: no-repeat;
}
.login-wrap {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background: radial-gradient(1200px 600px at 20% 10%, #e7eeff 0%, transparent 60%),
                radial-gradient(1000px 500px at 90% 90%, #e3fbf0 0%, transparent 55%),
                linear-gradient(135deg, #f3f6fc 0%, #eef2f8 100%);
}
body.login-bg .login-wrap {
    background: rgba(15, 23, 42, 0.45);
}
body.login-bg .login-box { background: rgba(255,255,255,0.95); }
.login-box {
    width: 380px; background: #fff; padding: 38px 34px; border-radius: 18px;
    box-shadow: 0 20px 60px rgba(31, 45, 80, 0.15);
    position: relative; overflow: hidden;
}
.login-box::before {
    content: ""; position: absolute; left: 0; top: 0; right: 0; height: 6px;
    background: var(--primary-grad);
}
.login-box h2 {
    margin: 0 0 6px; text-align: center; font-size: 22px; color: var(--text);
}
.login-box .sub { text-align: center; color: var(--text-2); margin: 0 0 26px; font-size: 13px; }
.login-box input {
    width: 100%; padding: 13px 14px; margin: 10px 0; border: 1px solid var(--border);
    border-radius: 10px; font-size: 15px; transition: border-color .2s, box-shadow .2s;
    background: #fafbfe;
}
.login-box input:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(47, 107, 255, 0.15); background: #fff;
}
.login-box button {
    width: 100%; padding: 13px; margin-top: 14px; background: var(--primary-grad); color: #fff;
    border: none; border-radius: 10px; cursor: pointer; font-size: 16px; font-weight: 600;
    box-shadow: 0 8px 20px rgba(47, 107, 255, 0.3); transition: transform .15s, box-shadow .15s;
}
.login-box button:hover { transform: translateY(-1px); box-shadow: 0 12px 26px rgba(47, 107, 255, 0.38); }
.login-box button:active { transform: translateY(0); }
.error { color: var(--danger); font-size: 13px; margin-top: 10px; text-align: center; }

/* ===== 后台布局 ===== */
.admin-layout { display: flex; min-height: 100vh; }

.sidebar {
    width: 170px; flex-shrink: 0;
    background: linear-gradient(180deg, var(--sidebar-bg) 0%, var(--sidebar-bg-2) 100%);
    color: #fff; display: flex; flex-direction: column;
    position: sticky; top: 0; height: 100vh;
}
.sidebar .logo {
    padding: 16px 14px; font-size: 14px; font-weight: 700; letter-spacing: .5px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    display: flex; align-items: center; gap: 8px;
}
.sidebar .logo::before {
    content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--primary-grad);
    box-shadow: 0 0 10px rgba(91, 141, 239, 0.8);
}
.sidebar ul { list-style: none; padding: 8px 10px 0; margin: 0; flex: 1; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.12) transparent; }
/* 侧边栏滚动条与底色相近 */
.sidebar ul::-webkit-scrollbar { width: 4px; }
.sidebar ul::-webkit-scrollbar-track { background: transparent; }
.sidebar ul::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 2px; }
.sidebar ul::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.22); }
.sidebar li { margin-bottom: 1px; }
.sidebar li a {
    display: flex; align-items: center; gap: 10px; padding: 9px 12px;
    color: rgba(255,255,255,0.7); text-decoration: none; border-radius: 6px;
    font-size: 13px; transition: background .2s, color .2s;
    position: relative;
}
.sidebar li a .nav-icon {
    width: 16px; height: 16px; flex-shrink: 0;
    color: rgba(255,255,255,0.55); transition: color .2s;
}
.sidebar li a:hover { background: rgba(255,255,255,0.06); color: #fff; }
.sidebar li a:hover .nav-icon { color: rgba(255,255,255,0.85); }
.sidebar li a.active {
    background: rgba(255,255,255,0.11); color: #fff; font-weight: 500;
}
.sidebar li a.active .nav-icon { color: #4ADE80; }
.sidebar li a.active::before {
    content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
    width: 3px; height: 16px; border-radius: 0 3px 3px 0;
    background: #4ADE80; box-shadow: 0 0 10px rgba(74, 222, 128, 0.45);
}
.sidebar .nav-section {
    padding: 14px 12px 6px; font-size: 10px;
    letter-spacing: .8px; color: rgba(255,255,255,0.3); font-weight: 600;
    pointer-events: none;
}
.sidebar .nav-divider {
    height: 1px; background: rgba(255,255,255,0.06); margin: 8px 12px;
}

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
    height: 60px; background: rgba(255,255,255,0.9); backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between; padding: 0 28px;
    position: sticky; top: 0; z-index: 10;
}
.topbar .role-tag {
    background: var(--primary-grad); color: #fff; padding: 5px 14px; border-radius: 20px;
    font-size: 13px; font-weight: 600;
}
.topbar .user { color: var(--text-2); font-size: 14px; }
.topbar .user a { color: var(--primary); text-decoration: none; font-weight: 600; }
.topbar .user a:hover { text-decoration: underline; }

.content { padding: 28px; flex: 1; }

/* ===== 页脚 ===== */
.admin-footer {
    padding: 16px 28px; border-top: 1px solid var(--border);
    color: var(--text-2); font-size: 13px; display: flex; gap: 20px; flex-wrap: wrap; align-items: center;
}
.admin-footer .beian, .admin-footer .contact { color: var(--text-2); }

/* ===== 卡片 ===== */
.card {
    background: var(--card); border-radius: var(--radius); padding: 22px; margin-bottom: 22px;
    box-shadow: var(--shadow); border: 1px solid var(--border);
    transition: box-shadow .2s, transform .2s;
}
.card:hover { box-shadow: var(--shadow-hover); }
.card h3 {
    margin: 0 0 18px; font-size: 16px; font-weight: 700; color: var(--text);
    padding-left: 12px; position: relative;
}
.card h3::before {
    content: ""; position: absolute; left: 0; top: 2px; bottom: 2px; width: 4px;
    border-radius: 4px; background: var(--primary-grad);
}

/* ===== 表格 ===== */
table.data { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; }
table.data th, table.data td { padding: 14px 16px; border-bottom: 1px solid var(--border); text-align: left; }
table.data th {
    background: #f7f9fc; font-weight: 600; color: var(--text-2); font-size: 13px;
    text-transform: none; letter-spacing: .3px;
}
table.data tbody tr { transition: background .15s; }
table.data tbody tr:hover { background: #f5f8ff; }
table.data tbody tr:last-child td { border-bottom: none; }

/* ===== 按钮 ===== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 8px 16px; border-radius: 9px; text-decoration: none; font-size: 14px;
    border: none; cursor: pointer; font-weight: 500; transition: transform .12s, box-shadow .2s, background .2s;
}
.btn-primary { background: var(--primary-grad); color: #fff; box-shadow: 0 6px 16px rgba(47, 107, 255, 0.28); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 9px 22px rgba(47, 107, 255, 0.36); }
.btn-danger { background: var(--danger); color: #fff; box-shadow: 0 6px 16px rgba(255, 91, 110, 0.28); }
.btn-danger:hover { transform: translateY(-1px); }
.btn-warning { background: #FF9800; color: #fff; box-shadow: 0 6px 16px rgba(255, 152, 0, 0.28); }
.btn-warning:hover { transform: translateY(-1px); }
.btn-success { background: #16a34a; color: #fff; box-shadow: 0 6px 16px rgba(22, 163, 74, 0.28); }
.btn-success:hover { transform: translateY(-1px); box-shadow: 0 9px 22px rgba(22, 163, 74, 0.36); }

/* ===== 弹窗（二维码等） ===== */
.modal-mask { position: fixed; inset: 0; background: rgba(15, 23, 42, .55); display: flex; align-items: center; justify-content: center; z-index: 9999; }
.modal-box { background: #fff; border-radius: 14px; width: 320px; max-width: 92vw; box-shadow: 0 20px 60px rgba(15, 23, 42, .35); overflow: hidden; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border); font-weight: 600; color: var(--text); }
.modal-close { border: none; background: transparent; font-size: 22px; line-height: 1; color: #94a3b8; cursor: pointer; }
.modal-close:hover { color: #475569; }
.modal-body { padding: 18px; text-align: center; }
.btn-sm { padding: 5px 12px; font-size: 13px; border-radius: 8px; }
table.data td.ops-cell { padding: 10px 8px; white-space: nowrap; }
table.data td.ops-cell .btn-sm { padding: 4px 10px; font-size: 12px; margin-right: 4px; }
.btn-ghost { background: #f1f4fa; color: var(--text); }
.btn-ghost:hover { background: #e7ecf5; }

/* ===== 统计卡片 ===== */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; }
.stat-card {
    background: var(--card); padding: 22px; border-radius: var(--radius);
    box-shadow: var(--shadow); border: 1px solid var(--border); position: relative; overflow: hidden;
    transition: box-shadow .2s, transform .2s;
}
.stat-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.stat-card::before {
    content: ""; position: absolute; left: 0; top: 0; right: 0; height: 4px;
    background: var(--primary-grad);
}
.stat-card .num { font-size: 32px; font-weight: 800; color: var(--primary); line-height: 1.1; }
.stat-card .label { color: var(--text-2); margin-top: 8px; font-size: 13px; }
.stat-card.alt-1::before { background: linear-gradient(135deg, #2bbf6a, #6ee7a8); }
.stat-card.alt-1 .num { color: var(--success); }
.stat-card.alt-2::before { background: linear-gradient(135deg, #ff9f2e, #ffc56b); }
.stat-card.alt-2 .num { color: var(--warning); }
.stat-card.alt-3::before { background: linear-gradient(135deg, #ff5b6e, #ff97a3); }
.stat-card.alt-3 .num { color: var(--danger); }
.stat-card.alt-4::before { background: linear-gradient(135deg, #8a5bef, #b794f6); }
.stat-card.alt-4 .num { color: #8a5bef; }

/* ===== 表单 ===== */
.form-row { margin-bottom: 18px; }
.form-row label { display: block; margin-bottom: 7px; font-weight: 600; color: var(--text); font-size: 13px; }
.form-row input, .form-row select, .form-row textarea {
    width: 100%; max-width: 460px; height: 40px; box-sizing: border-box;
    padding: 0 14px; border: 1px solid var(--border);
    border-radius: 10px; font-size: 14px; line-height: 1;
    background: #fafbfe; transition: border-color .2s, box-shadow .2s;
}
.form-row textarea { height: auto; padding: 10px 14px; line-height: 1.5; }
.form-row .btn { height: 40px; box-sizing: border-box; display: inline-flex; align-items: center; padding: 0 18px; }
.form-row input:focus, .form-row select:focus, .form-row textarea:focus {
    outline: none; border-color: var(--primary); background: #fff;
    box-shadow: 0 0 0 3px rgba(47, 107, 255, 0.14);
}
/* 筛选区等一行内表单项与按钮严格对齐 */
form.inline-form input, form.inline-form select, form.inline-form button, form.inline-form .btn {
    height: 40px; box-sizing: border-box; vertical-align: middle;
}
form.inline-form input, form.inline-form select {
    padding: 0 14px;
}
form.inline-form button, form.inline-form .btn {
    display: inline-flex; align-items: center; padding: 0 18px;
}

/* ===== 分页 ===== */
.pagination { margin-top: 18px; display: flex; gap: 8px; flex-wrap: wrap; }
.pagination a {
    padding: 7px 13px; text-decoration: none; color: var(--text-2);
    border: 1px solid var(--border); border-radius: 9px; font-size: 13px; transition: all .2s;
}
.pagination a:hover, .pagination a.active {
    background: var(--primary-grad); color: #fff; border-color: transparent;
    box-shadow: 0 4px 12px rgba(47, 107, 255, 0.3);
}

/* ===== 提示 & 状态 ===== */
.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 18px; font-size: 14px; }
.alert-success { background: #e9fbf1; border: 1px solid #b6efce; color: #1d8a4f; }
.alert-error { background: #fdecef; border: 1px solid #f6c2cb; color: #c0314a; }
.alert-info { background: #eaf1ff; border: 1px solid #c2d6ff; color: #1f56c4; }
.tip { color: var(--text-2); font-size: 13px; line-height: 1.7; margin: 8px 0 18px; }

/* 状态徽标 */
.badge {
    display: inline-block; padding: 3px 11px; border-radius: 20px; font-size: 12px;
    font-weight: 600; line-height: 1.6;
}
.badge-green { background: #e9fbf1; color: #1d8a4f; }
.badge-blue  { background: #eaf1ff; color: #1f56c4; }
.badge-orange{ background: #fff3e0; color: #b9720a; }
.badge-red   { background: #ffecef; color: #c8323f; }
.badge-gray  { background: #f1f4fa; color: #6b7785; }

/* 两列卡片布局 */
.row-2 { display: flex; gap: 22px; flex-wrap: wrap; }
.row-2 > .card { flex: 1; min-width: 320px; margin-bottom: 22px; }

/* 详情页双列表格 */
.info-table { width: 100%; border-collapse: collapse; }
.info-table td { padding: 14px 16px; border: 1px solid var(--border); vertical-align: top; }
.info-table td.label {
    width: 12%; background: #f7f9fc; color: var(--text-2); font-weight: 600; font-size: 13px;
    white-space: nowrap;
}
.info-table td.value { width: 38%; color: var(--text); background: #fff; }
@media (max-width: 900px) {
    .info-table td.label, .info-table td.value { width: 50%; }
    .info-table tr { display: flex; flex-wrap: wrap; }
    .info-table td { width: 50%; }
}

/* ===== 开关 switch ===== */
.switch { position: relative; display: inline-block; width: 46px; height: 24px; vertical-align: middle; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; cursor: pointer; inset: 0; background: #cfd6e4; border-radius: 24px; transition: .2s; }
.switch .slider::before { content: ""; position: absolute; height: 18px; width: 18px; left: 3px; bottom: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + .slider { background: var(--primary); }
.switch input:checked + .slider::before { transform: translateX(22px); }

/* ===== 拖拽排序 ===== */
.drag-handle { cursor: move; color: #aab3c2; text-align: center; user-select: none; }
#jtTable tbody tr[draggable="true"]:hover { background: #f5f8ff; }
#jtTable tbody tr[draggable="true"] { transition: background .15s; }

