/* ============================================================
   禾邦电子 - 后台管理样式
   主题：清透大气 × 青蓝紫渐变（与前台一致）
   ============================================================ */
:root {
    --navy: #1E3A8A;
    --indigo: #1D4ED8;
    --indigo2: #3B82F6;
    --purple: #6366F1;
    --violet: #8B5CF6;
    --blue: #3B82F6;
    --cyan: #06B6D4;
    --sky: #0EA5E9;
    --teal: #14B8A6;
    --orange: #F97316;
    --pink: #F472B6;
    --gold: #F59E0B;
    --gold-light: #FBBF24;
    --bg: #F4F8FB;
    --price: #e4393c;
    --grad-brand: linear-gradient(90deg, #06B6D4, #3B82F6 55%, #6366F1);
    --grad-vivid: linear-gradient(135deg, #06B6D4, #3B82F6 50%, #8B5CF6);
    --grad-deep: linear-gradient(120deg, #0EA5E9 0%, #2563EB 55%, #4F46E5 100%);
    --grad-gold: linear-gradient(135deg, #FBBF24, #F97316);
    --shadow-sm: 0 1px 3px rgba(30,58,138,.06), 0 4px 14px rgba(59,130,246,.06);
    --shadow-md: 0 8px 20px rgba(30,58,138,.10), 0 16px 40px rgba(59,130,246,.12);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font: 14px/1.7 "Segoe UI", "Microsoft YaHei", sans-serif; color: #1F2437; background: var(--bg); }
a { color: var(--indigo2); text-decoration: none; }
ul { list-style: none; }
.red { color: var(--price); font-style: normal; }
.green { color: #10B981; font-style: normal; }
::selection { background: rgba(59,130,246,.18); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: linear-gradient(180deg, #A5C8F5, #7C9FE0); border-radius: 6px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, #7C9FE0, #5B82C8); }

/* 顶部 */
.admin-top { background: var(--grad-deep); height: 56px; color: #fff; box-shadow: 0 4px 16px rgba(37,99,235,.25); position: relative; z-index: 10; }
.admin-top-inner { width: auto; margin: 0 auto; padding: 0 24px; display: flex; justify-content: space-between; align-items: center; height: 56px; }
.admin-logo { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: bold; letter-spacing: 1px; }
.al-mark { display: inline-flex; width: 34px; height: 34px; background: var(--grad-gold); color: #fff; border-radius: 9px; align-items: center; justify-content: center; font-size: 18px; box-shadow: 0 3px 10px rgba(249,115,22,.45); }
.al-name em { font-size: 13px; font-weight: normal; opacity: .85; font-style: normal; }
.admin-user a, .admin-user span { color: #fff; margin-left: 12px; font-size: 13px; }
.admin-user a:hover { color: var(--gold-light); }
.admin-user .divider { opacity: .4; }
.admin-user .logout { border: 1px solid rgba(255,255,255,.5); padding: 3px 12px; border-radius: 14px; transition: all .2s; }
.admin-user .logout:hover { background: rgba(255,255,255,.15); color: #fff; }
.admin-role { font-size: 12px; opacity: .8; margin-left: 6px !important; background: rgba(255,255,255,.15); padding: 2px 8px; border-radius: 10px; }

/* 主体 */
.admin-body { width: auto; margin: 0 auto; display: flex; gap: 14px; padding: 16px 24px 40px; min-height: calc(100vh - 56px); }
.admin-side { width: 190px; flex-shrink: 0; background: #fff; border-radius: 12px; overflow: hidden; box-shadow: var(--shadow-sm); border: 1px solid #E5E9F2; align-self: flex-start; position: sticky; top: 16px; }
.admin-side ul li a { display: block; padding: 13px 20px; color: #55607A; border-left: 3px solid transparent; transition: all .2s; }
.admin-side ul li a:hover { background: linear-gradient(90deg, #F0EDFF, #F8FAFF); color: var(--purple); }
.admin-side ul li.on a { background: linear-gradient(90deg, #E9E6FF, #F4F9FF); color: var(--indigo); border-left-color: var(--gold); font-weight: bold; }
.admin-main { flex: 1; min-width: 0; }

/* 页面标题 */
.page-title { font-size: 18px; font-weight: bold; color: var(--indigo); margin-bottom: 14px; display: flex; justify-content: space-between; align-items: center; letter-spacing: .5px; }

/* 面板与表格 */
.panel { background: #fff; border-radius: 12px; padding: 18px; margin-bottom: 14px; box-shadow: var(--shadow-sm); border: 1px solid #E5E9F2; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { border-bottom: 1px solid #EEF2FA; padding: 9px 10px; font-size: 13px; text-align: left; }
.admin-table th { background: linear-gradient(90deg, #F0EDFF, #F2FAFF); color: var(--indigo2); font-weight: bold; white-space: nowrap; }
.admin-table tr:hover td { background: linear-gradient(90deg, #F6F4FF, #F5FAFF); }
.admin-table .empty { text-align: center; color: #B7C1D4; padding: 30px 0; }
.admin-table .tier-cell span { display: inline-block; background: #FFF6F6; color: var(--price); border: 1px solid #FFE3E3; border-radius: 4px; padding: 0 6px; margin-right: 4px; font-size: 12px; }

/* 统计卡片 */
.stat-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 14px; }
.stat-card { position: relative; background: #fff; border-radius: 12px; padding: 18px 10px; text-align: center; border: 1px solid #E5E9F2; border-top: 3px solid var(--blue); box-shadow: var(--shadow-sm); overflow: hidden; transition: transform .2s, box-shadow .2s; }
.stat-card::after { content: ""; position: absolute; width: 90px; height: 90px; border-radius: 50%; background: radial-gradient(circle, rgba(59,130,246,.10), transparent 70%); right: -30px; top: -30px; }
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.stat-card.blue { border-top-color: var(--gold); }
.stat-card b { display: block; font-size: 28px; color: var(--indigo); position: relative; }
.stat-card span { font-size: 12px; color: #98A2B8; position: relative; }

.panel-row { display: flex; gap: 14px; }
.panel-row .panel { flex: 1; }
.panel-head { font-weight: bold; color: var(--indigo); border-left: 4px solid var(--gold); padding-left: 10px; margin-bottom: 10px; }

/* 按钮 */
.btn { display: inline-block; border: 1px solid #D5D2EC; background: #fff; color: #55607A; padding: 5px 14px; border-radius: 6px; cursor: pointer; font-size: 13px; line-height: 1.6; transition: all .2s; }
.btn:hover { border-color: var(--purple); color: var(--purple); }
.btn-green { background: var(--grad-brand); border-color: transparent; color: #fff; box-shadow: 0 3px 10px rgba(59,130,246,.3); }
.btn-green:hover { color: #fff; border-color: transparent; filter: brightness(1.1); }
.btn-red { background: var(--grad-hot, linear-gradient(135deg, #F97316, #F472B6)); border-color: transparent; color: #fff; box-shadow: 0 3px 10px rgba(244,114,182,.3); }
.btn-red:hover { color: #fff; filter: brightness(1.08); }
.btn-sm { padding: 2px 10px; font-size: 12px; border-radius: 4px; }
.btn-lg { padding: 9px 30px; font-size: 15px; border-radius: 20px; }

/* 筛选 */
.filter-bar { background: #fff; border-radius: 12px; padding: 12px 16px; margin-bottom: 14px; box-shadow: var(--shadow-sm); border: 1px solid #E5E9F2; }
.filter-bar select, .filter-bar input[type=text] { height: 34px; border: 1px solid #D5D2EC; border-radius: 6px; padding: 0 10px; margin-right: 8px; transition: border-color .2s, box-shadow .2s; }
.filter-bar select:focus, .filter-bar input[type=text]:focus { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(59,130,246,.12); }
.tip-bar { background: linear-gradient(90deg, #F0EDFF, #EDF9FF); border: 1px solid #C9B8F5; color: var(--indigo); border-radius: 8px; padding: 8px 14px; margin-bottom: 14px; font-size: 13px; }

/* 表单 */
.lf-item { margin-bottom: 14px; }
.lf-item label { display: block; font-size: 13px; color: #7B869E; margin-bottom: 5px; }
.lf-item input[type=text], .lf-item input[type=password], .lf-item input[type=number], .lf-item select, .lf-item textarea {
    width: 100%; max-width: 640px; border: 1px solid #D5D2EC; border-radius: 6px; padding: 9px 12px; font-size: 14px; font-family: inherit;
    transition: border-color .2s, box-shadow .2s;
}
.lf-item input:focus, .lf-item select:focus, .lf-item textarea:focus { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(59,130,246,.12); }
.lf-item textarea { resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 24px; }
.form-foot { padding-top: 8px; border-top: 1px solid #EEF2FA; margin-top: 10px; display: flex; align-items: center; gap: 20px; }
.chk { font-size: 14px; color: #55607A; }

/* 阶梯价编辑 */
.tier-edit { background: linear-gradient(135deg, #F0EDFF, #EDF9FF); border: 1px dashed #B9B0F0; border-radius: 8px; padding: 12px 16px; margin: 14px 0; }
.te-title { display: block; font-weight: bold; color: var(--indigo2); margin-bottom: 10px; }
.te-row { display: flex; gap: 20px; }
.te-item { background: #fff; border: 1px solid #D5D2EC; border-radius: 8px; padding: 10px 14px; font-size: 13px; color: #7B869E; box-shadow: var(--shadow-sm); }
.te-item em { color: var(--price); font-style: normal; font-weight: bold; margin-right: 8px; }
.te-item input { width: 90px; border: 1px solid #D5D2EC; border-radius: 4px; padding: 5px 8px; margin: 0 6px; }

/* 分类管理 */
.cat-block { border: 1px solid #E5E9F2; border-radius: 12px; margin-bottom: 12px; overflow: hidden; background: #fff; box-shadow: var(--shadow-sm); }
.cat-big-row { background: linear-gradient(90deg, #F0EDFF, #F6FAFF); padding: 10px 16px; display: flex; align-items: center; gap: 14px; }
.cat-big-row .cat-name { font-weight: bold; color: var(--indigo); font-size: 15px; }
.cat-meta { font-size: 12px; color: #98A2B8; flex: 1; }
.cat-ops { display: flex; gap: 6px; }
.cat-subs { padding: 4px 16px; }
.cat-sub-row { display: flex; align-items: center; gap: 14px; padding: 6px 0; border-bottom: 1px dashed #EEF2FA; }
.cat-sub-row:last-child { border-bottom: 0; }
.cat-sub-row .cs-name { width: 320px; color: #55607A; }
.cat-sub-row.empty { color: #B7C1D4; }
.sort-input { width: 70px; border: 1px solid #D5D2EC; border-radius: 4px; padding: 3px 6px; }

/* 产品管理：名次语义 */
.rank-help { background: #EFF6FF; border: 1px solid #CFE0FF; color: #3B5B8C; font-size: 12px; line-height: 1.7; padding: 8px 14px; border-radius: 8px; margin-bottom: 12px; }
.rank-tag { display: inline-block; min-width: 64px; text-align: center; background: #EEF3FF; color: #2b6cb0; border: 1px solid #CFE0FF; border-radius: 10px; padding: 1px 8px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.ins-cell { min-width: 138px; }
.ins-cell a { display: block; box-sizing: border-box; text-align: center; margin: 2px 0; white-space: nowrap; }
.ins-cell .ins-before { background: var(--grad-brand); border-color: transparent; color: #fff; box-shadow: 0 2px 6px rgba(59,130,246,.28); }
.ins-cell .ins-before:hover { color: #fff; filter: brightness(1.1); }
.ins-cell .ins-after { background: #fff; }

/* 弹层 */
.modal { display: none; position: fixed; inset: 0; background: rgba(30,58,138,.5); z-index: 100; align-items: center; justify-content: center; backdrop-filter: blur(3px); }
.modal.show { display: flex; }
.modal-box { background: #fff; border-radius: 14px; width: 460px; max-height: 86vh; overflow: auto; box-shadow: 0 20px 60px rgba(30,58,138,.35); animation: modalIn .22s ease; }
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-head { background: var(--grad-deep); color: #fff; padding: 13px 18px; font-size: 15px; font-weight: bold; border-radius: 14px 14px 0 0; letter-spacing: 1px; }
.modal-body { padding: 18px; }
.modal-body .lf-item input, .modal-body .lf-item select { max-width: none; }
.modal-foot { padding: 0 18px 18px; text-align: right; }
.modal-foot .btn { margin-left: 10px; }

/* 分页 */
.pager { margin-top: 16px; text-align: center; font-size: 13px; }
.pager a, .pager span { display: inline-block; padding: 5px 12px; margin: 0 3px; border: 1px solid #D5D2EC; color: #55607A; border-radius: 14px; background: #fff; transition: all .2s; }
.pager a:hover { border-color: var(--purple); color: var(--purple); }
.pager .cur { background: var(--grad-brand); color: #fff; border-color: transparent; box-shadow: 0 3px 10px rgba(59,130,246,.35); }

/* 登录页 */
.login-body { background: linear-gradient(120deg, #0EA5E9 0%, #2563EB 55%, #7C3AED 100%); display: flex; align-items: center; justify-content: center; min-height: 100vh; position: relative; overflow: hidden; }
.login-body::before { content: ""; position: absolute; width: 480px; height: 480px; border-radius: 50%; background: radial-gradient(circle, rgba(244,114,182,.30), transparent 65%); top: -160px; right: -120px; }
.login-body::after { content: ""; position: absolute; width: 320px; height: 320px; border-radius: 50%; background: radial-gradient(circle, rgba(251,191,36,.22), transparent 65%); bottom: -120px; left: -80px; }
.login-box { background: #fff; width: 400px; border-radius: 16px; padding: 34px 38px; box-shadow: 0 20px 60px rgba(30,58,138,.4); position: relative; z-index: 2; animation: loginIn .4s ease; }
@keyframes loginIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.login-logo { text-align: center; margin-bottom: 22px; }
.login-logo .al-mark { width: 54px; height: 54px; font-size: 26px; display: inline-flex; border-radius: 14px; box-shadow: 0 6px 18px rgba(249,115,22,.45); }
.login-logo h2 { font-size: 18px; color: var(--indigo); margin-top: 12px; letter-spacing: 1px; }
.login-form .lf-item input { max-width: none; }
.btn-login { width: 100%; background: var(--grad-brand); color: #fff; border: 0; padding: 11px 0; font-size: 16px; border-radius: 22px; cursor: pointer; margin-top: 6px; box-shadow: 0 5px 16px rgba(59,130,246,.35); transition: all .2s; letter-spacing: 2px; }
.btn-login:hover { filter: brightness(1.1); transform: translateY(-1px); box-shadow: 0 8px 22px rgba(99,102,241,.4); }
.login-tip { text-align: center; font-size: 12px; color: #A7AEC8; margin-top: 14px; }

/* 参数选项筛选复选框 + 状态列参数标签 */
.filter-bar .opt-filter { display: inline-block; margin: 0 8px 0 2px; vertical-align: middle; cursor: pointer; font-size: 13px; color: #444; user-select: none; }
.filter-bar .opt-filter input[type=checkbox] { vertical-align: -2px; margin-right: 4px; cursor: pointer; }
.opt-tag { display: inline-block; font-size: 12px; line-height: 1; padding: 3px 7px; border-radius: 10px; background: rgba(59,130,246,.12); color: #2563EB; white-space: nowrap; }
.opt-tag-off { font-size: 12px; color: #B0B7C3; font-style: normal; }

/* 参数选项行的前插/后插按钮（复用产品列表配色） */
.btn-sm.ins-before { background: var(--grad-brand); border-color: transparent; color: #fff; box-shadow: 0 2px 6px rgba(59,130,246,.28); }
.btn-sm.ins-before:hover { color: #fff; filter: brightness(1.1); }
.btn-sm.ins-after { background: #fff; }
