/* ==========================================================
 * 后台维护端专属样式（在 base.css 之后加载）
 * 设计语言：Windows 11 Fluent
 * 只含后台特有组件：门控页、定额模板表格、采纳按钮等
 * 通用组件（按钮/表单/规则表格/模态框）复用 base.css
 * ========================================================== */

.wrap { max-width: 1080px; margin: 0 auto; padding: 24px 20px 60px; }

/* ========== 顶栏：Win11 卡片式标题栏 ========== */
header {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 22px 20px; margin-bottom: 20px; box-shadow: var(--raised-1);
  position: relative; overflow: hidden;
}
/* 2026-10-25：去掉左侧 4px 品牌竖条（新拟物禁止单侧强调条） */
header::before { display: none; }
header h1 { font-size: 22px; font-weight: 600; letter-spacing: -0.015em; color: var(--text); }
header p { color: var(--muted); margin-top: 6px; font-size: 13px; }
.header-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.header-actions { display: flex; align-items: center; gap: 10px; }

/* ========== 访问门控页 ==========
 * 2026-10-25：满宽大卡 → 居中引导卡（原 1080px 宽、上下 500px 空白，像没做完） */
.gate { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 40px 28px; text-align: center; box-shadow: var(--raised-2); max-width: 480px; margin: 40px auto 0; }
.gate .ic { font-size: 40px; margin-bottom: 12px; }
.gate h2 { font-size: 17px; margin-bottom: 8px; }
.gate p { color: var(--muted); font-size: 13px; margin-bottom: 20px; max-width: 32ch; margin-left: auto; margin-right: auto; line-height: 1.7; }
.gate .btn { min-width: 160px; }

/* ========== 后台主界面 ========== */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--raised-1); }
.admin-panel { display: flex; flex-direction: column; }

/* ========== 标签页（后台，多页签） ========== */
.tabs { display: flex; background: rgba(0,0,0,0.05); border-radius: var(--radius); padding: 3px; margin-bottom: 16px; flex-wrap: wrap; }
body.dark .tabs { background: rgba(255,255,255,0.05); }
.tab { flex: 1; min-width: 100px; border: none; background: none; padding: 9px; font-size: 13px; color: var(--muted); cursor: pointer; border-radius: var(--radius-sm); white-space: nowrap; font-weight: 500; }
.tab:hover { color: var(--text); }
.tab.active { background: var(--card); color: var(--text); font-weight: 600; box-shadow: var(--shadow-1); }

/* ========== 规则表格（后台：含内联编辑输入框 + 采纳按钮） ========== */
.rules-toolbar input, .rules-toolbar select { padding: 9px 12px; border: 1px solid transparent; border-radius: var(--radius-sm); font-size: 13px; background: var(--sunken-bg); color: var(--text); box-shadow: var(--sunken-1); }
.rules-toolbar input:focus, .rules-toolbar select:focus { outline: none; border-color: transparent; box-shadow: var(--sunken-focus); }
.rules-table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); min-height: 260px; background: var(--card); }
.rules-table th { background: var(--card); text-align: left; padding: 9px 10px; font-weight: 600; border-bottom: 1px solid var(--line); position: sticky; top: 0; white-space: nowrap; z-index: 1; color: var(--muted); }
.rules-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.rules-table tr:hover td { background: var(--fill-hover); }
.rules-table input { width: 100%; padding: 5px 8px; border: 1px solid transparent; border-radius: 9px; font-size: 12px; background: var(--sunken-bg); color: var(--text); box-sizing: border-box; }
.rules-table input:focus { outline: none; border-color: transparent; box-shadow: var(--sunken-focus); }
.rules-cell { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.rules-cell .muted { color: var(--muted); font-size: 11px; }
.rules-op { display: flex; gap: 6px; flex-wrap: wrap; }
.rules-op .adopt { border-color: rgba(78,205,196,0.4); color: var(--down); }
.rules-op .adopt:hover { background: rgba(78,205,196,0.12); border-color: var(--down); }
.rules-empty { text-align: center; color: var(--muted); padding: 44px; font-size: 13px; }
.rules-pager { display: flex; gap: 10px; align-items: center; justify-content: center; margin-top: 14px; }
.rules-pager span { font-size: 13px; color: var(--muted); }
.meta { font-size: 12px; color: var(--muted); }
.hint2 { color: var(--muted); font-size: 12px; margin-bottom: 10px; }

/* ========== 表单（复用 base 的 rf-*，此处补后台细节） ========== */
.rules-form { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; background: var(--card); box-shadow: var(--shadow-1); }
.rf-title { font-weight: 600; font-size: 13px; margin-bottom: 12px; color: var(--text); }
.rf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.rf-group { display: flex; flex-direction: column; gap: 6px; }
.rf-group label { font-size: 12px; color: var(--muted); }
.rf-group input { padding: 8px 10px; border: 1px solid transparent; border-radius: var(--radius-sm); font-size: 13px; background: var(--sunken-bg); color: var(--text); box-shadow: var(--sunken-1); }
.rf-group input:focus { outline: none; border-color: transparent; box-shadow: var(--sunken-focus); }
.rf-foot { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.rf-foot select { padding: 8px 10px; border: 1px solid transparent; border-radius: var(--radius-sm); font-size: 13px; background: var(--sunken-bg); color: var(--text); box-shadow: var(--sunken-1); }
.rf-foot .err { width: 100%; margin: 0; color: var(--up); font-size: 12px; }

/* ========== 模态框（复用 base，补后台宽度细节） ========== */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.45); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal-box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); width: 400px; max-width: 92vw; padding: 24px; box-shadow: var(--raised-3); color: var(--text); }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.modal-head b { font-size: 16px; }
.close { background: none; border: none; font-size: 22px; color: var(--muted); cursor: pointer; line-height: 1; border-radius: var(--radius-sm); width: 28px; height: 28px; }
.close:hover { background: var(--fill-hover); color: var(--text); }
.msg-bar { background: rgba(219,0,0,0.10); color: var(--up); font-size: 12px; padding: 8px 12px; border-radius: var(--radius-sm); margin-bottom: 12px; }
.field { margin-bottom: 12px; }
.field input { width: 100%; padding: 11px 12px; border: 1px solid transparent; border-radius: var(--radius-sm); font-size: 14px; box-sizing: border-box; background: var(--sunken-bg); color: var(--text); box-shadow: var(--sunken-1); }
.field input:focus { outline: none; border-color: transparent; box-shadow: var(--sunken-focus); }
.code-row { display: flex; gap: 8px; }
.code-row input { flex: 1; }
.err { color: var(--up); font-size: 12px; margin-top: 4px; min-height: 16px; }
.wechat-tip { color: var(--muted); font-size: 13px; text-align: center; margin-bottom: 14px; }
.btn-lg { padding: 13px 26px; font-size: 15px; width: 100%; justify-content: center; }

/* ========== 企业风控页签 ========== */
#adminPanel-enterprise .rules-table td:last-child { white-space: nowrap; }
#adminPanel-enterprise .rules-table .btn {
  padding: 4px 10px; font-size: 12px; border-radius: var(--radius-sm); box-shadow: none;
}
#adminPanel-enterprise .rules-table td { vertical-align: middle; }
#adminPanel-enterprise .rules-table td .badge { white-space: nowrap; }

/* ==========================================================
 * 凸凹材质补丁（2026-10-21）：本文件重复声明了 base 的 .tabs / .card，
 * 同特异性下会盖掉 base，所以凹面轨道与输入框要在这里再声明一次。
 * ========================================================== */
.tabs { background: var(--sunken-bg); box-shadow: var(--sunken-1); }
.tab.active { box-shadow: var(--raised-1); }
.rules-table input { background: var(--sunken-bg); box-shadow: var(--sunken-1); }
.rules-table input:focus { box-shadow: var(--sunken-focus); }
.rules-table-wrap { box-shadow: var(--sunken-1); }
