/* ==========================================================
   WX工具箱 管理后台样式
   风格：简洁现代 + Windows 原生观感（浅色、直角偏圆、细边框）
   版权：©伟贤文化传媒集团(WXCMG)
   ========================================================== */

* { box-sizing: border-box; }

:root {
  --bg: #f3f4f6;
  --card: #ffffff;
  --border: #e3e5e9;
  --text: #1f2328;
  --text-2: #6b7280;
  --primary: #0a6ed1;      /* Windows 蓝 */
  --primary-hover: #095cae;
  --danger: #d13438;
  --success: #107c10;
  --radius: 6px;
}

body {
  margin: 0;
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}

/* ---------- 顶部栏 ---------- */
.topbar {
  height: 52px;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px;
  position: sticky; top: 0; z-index: 10;
}
.topbar-left { display: flex; align-items: center; gap: 10px; }
.topbar-logo { width: 26px; height: 26px; object-fit: contain; }
.brand { font-size: 16px; font-weight: 600; letter-spacing: .5px; }
.brand em { font-style: normal; font-size: 12px; color: var(--text-2); margin-left: 6px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.who { color: var(--text-2); }

/* ---------- 主体 ---------- */
.wrap { max-width: 1180px; margin: 20px auto; padding: 0 16px 40px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tab {
  padding: 9px 18px; border: none; background: transparent; cursor: pointer;
  font-size: 14px; color: var(--text-2); border-bottom: 2px solid transparent;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

.panel { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.hidden { display: none !important; }

.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.hint { color: var(--text-2); font-size: 12px; }

/* ---------- 表单控件 ---------- */
.input, .textarea, select.input {
  height: 32px; padding: 0 10px; border: 1px solid var(--border); border-radius: 4px;
  background: #fff; color: var(--text); outline: none; min-width: 160px; font-size: 13px;
  font-family: inherit;
}
.input:focus, .textarea:focus { border-color: var(--primary); }
.textarea { height: auto; padding: 8px 10px; width: 100%; resize: vertical; min-height: 90px; }

.btn-primary {
  height: 32px; padding: 0 16px; background: var(--primary); color: #fff; border: none;
  border-radius: 4px; cursor: pointer; font-size: 13px; font-family: inherit;
}
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary.block { width: 100%; height: 38px; font-size: 15px; }

.btn-ghost {
  height: 32px; padding: 0 14px; background: #fff; color: var(--text);
  border: 1px solid var(--border); border-radius: 4px; cursor: pointer; font-size: 13px; font-family: inherit;
}
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }

.link-btn { background: none; border: none; color: var(--primary); cursor: pointer; padding: 0 6px; font-size: 13px; }
.link-btn.danger { color: var(--danger); }
.link-btn:hover { text-decoration: underline; }

.icon-btn { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--text-2); line-height: 1; }

/* ---------- 表格 ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { padding: 9px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.table th { background: #fafbfc; font-weight: 600; color: var(--text-2); }
.table tr:hover td { background: #fafbfc; }
.table td.url { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { text-align: center; color: var(--text-2); padding: 30px 0; }

.tag { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; }
.tag.on { background: #e6f4ea; color: var(--success); }
.tag.off { background: #f1f1f1; color: var(--text-2); }
.tag.admin { background: #e8f1fb; color: var(--primary); }
.tag.user { background: #f1f1f1; color: var(--text-2); }

.pager { margin-top: 12px; display: flex; gap: 6px; justify-content: flex-end; align-items: center; font-size: 13px; color: var(--text-2); }

/* ---------- 弹窗 ---------- */
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.35); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal { width: 520px; max-width: 92vw; background: #fff; border-radius: var(--radius); box-shadow: 0 8px 28px rgba(0,0,0,.18); }
.modal-head { padding: 12px 16px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; font-weight: 600; }
.modal-body { padding: 16px; max-height: 62vh; overflow: auto; }
.modal-foot { padding: 12px 16px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }
.modal-body .field { margin-bottom: 12px; }
.modal-body label { display: block; margin-bottom: 5px; color: var(--text-2); font-size: 13px; }
.modal-body .input, .modal-body .textarea { width: 100%; }

/* ---------- 登录页 ---------- */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(160deg, #eef4fb, #f5f6f8); }
.login-card { width: 360px; background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 32px 28px 20px; box-shadow: 0 6px 24px rgba(0,0,0,.06); }
.login-brand { text-align: center; margin-bottom: 24px; }
.login-logo { width: 54px; height: 54px; margin: 0 auto 10px; border-radius: 12px; background: transparent; object-fit: contain; display: block; }
.login-brand h1 { margin: 0 0 4px; font-size: 20px; }
.login-brand p { margin: 0; color: var(--text-2); font-size: 12px; }
.login-card .field { margin-bottom: 14px; }
.login-card label { display: block; margin-bottom: 5px; color: var(--text-2); font-size: 13px; }
.login-card .input { width: 100%; height: 36px; }
.tip { min-height: 18px; margin: 10px 0 0; text-align: center; color: var(--danger); font-size: 13px; }
.login-foot { margin-top: 16px; text-align: center; color: var(--text-2); font-size: 12px; }

/* ---------- 论坛管理：二级子标签 ---------- */
.subtabs { display: flex; gap: 4px; margin-bottom: 14px; border-bottom: 1px solid var(--border); }
.subtab {
  padding: 8px 16px; background: none; border: none; border-bottom: 2px solid transparent;
  font-size: 13px; color: var(--text-2); cursor: pointer; font-family: inherit;
}
.subtab:hover { color: var(--text); }
.subtab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* 板块图标预览 */
.board-icon { font-size: 18px; }

.foot { text-align: center; color: var(--text-2); font-size: 12px; padding: 10px 0 24px; }
