/* ============================================================
   喜报管理后台 · PC 专用（不参与手机端 H5）
   ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", -apple-system, sans-serif;
  background: #F5F7FA;
  color: #1F2329;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

/* ---------- 顶栏 ---------- */
.topbar {
  height: 54px;
  background: #fff;
  border-bottom: 1px solid #E5E8EC;
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 14px;
}
.topbar .brand { font-size: 15px; font-weight: 600; letter-spacing: .2px; }
.topbar .sub { font-size: 13px; color: #8B929A; }
.topbar .right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.wrap { max-width: 1440px; margin: 0 auto; padding: 20px 28px 60px; }

.card {
  background: #fff;
  border: 1px solid #E5E8EC;
  border-radius: 8px;
  margin-bottom: 16px;
}

/* ---------- 筛选区 ---------- */
.filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px 28px;
  padding: 20px 24px 4px;
}
.f-item label { display: block; font-size: 13px; color: #4E5969; margin-bottom: 6px; }
.f-item input,
.f-item select {
  width: 100%; height: 34px; padding: 0 10px;
  border: 1px solid #D9DEE5; border-radius: 4px;
  font-size: 14px; font-family: inherit; color: #1F2329;
  outline: none; background: #fff;
}
.f-item input:focus, .f-item select:focus { border-color: #1677FF; box-shadow: 0 0 0 2px rgba(22,119,255,.1); }
.f-item input::placeholder { color: #B4BAC3; }

.f-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px 20px; }

/* ---------- 按钮 ---------- */
.btn {
  height: 34px; padding: 0 18px;
  border: 1px solid #D9DEE5; border-radius: 4px;
  background: #fff; color: #1F2329;
  font-size: 14px; font-family: inherit; cursor: pointer;
  transition: all .15s;
}
.btn:hover { border-color: #1677FF; color: #1677FF; }
.btn.primary { background: #1677FF; border-color: #1677FF; color: #fff; }
.btn.primary:hover { background: #4096FF; border-color: #4096FF; color: #fff; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn:disabled:hover { border-color: #D9DEE5; color: #1F2329; }
.btn.primary:disabled:hover { background: #1677FF; color: #fff; }

/* ---------- 列表头部 ---------- */
.list-head {
  display: flex; align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid #E5E8EC;
}
.list-head h2 { font-size: 15px; font-weight: 600; }
.list-head .count { font-size: 13px; color: #8B929A; margin-left: 10px; font-weight: 400; }
.list-head .right { margin-left: auto; display: flex; gap: 10px; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
/* 固定列宽：内容长短不再影响列宽，消除横向抖动 */
table { width: 100%; border-collapse: collapse; min-width: 1040px; table-layout: fixed; }
thead th {
  background: #FAFBFC;
  font-size: 13px; font-weight: 500; color: #4E5969;
  text-align: left; padding: 12px 16px;
  border-bottom: 1px solid #E5E8EC;
  white-space: nowrap;
}
tbody td {
  padding: 0 16px;
  height: 56px;                 /* 固定行高，换行也不会撑高 */
  border-bottom: 1px solid #F0F2F5;
  font-size: 14px; color: #1F2329;
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #F7F9FC; }
tbody tr.flash { animation: flash 2.2s ease; }
@keyframes flash {
  0% { background: #E8F3FF; }
  70% { background: #E8F3FF; }
  100% { background: transparent; }
}

td.note-cell { font-weight: 500; }
td.note-cell .nt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
td.note-cell .sub { display: block; font-size: 12px; color: #8B929A; font-weight: 400; margin-top: 2px; }
.mono { font-family: "SF Mono", Consolas, Monaco, monospace; font-size: 13px; }
.muted { color: #8B929A; }

.badge {
  display: inline-block; padding: 2px 9px; border-radius: 10px;
  font-size: 12px; line-height: 18px; white-space: nowrap;
}
.badge.on { background: #E8F5E9; color: #1A7F4B; }
.badge.off { background: #F0F2F5; color: #6B7280; }
.badge.exp { background: #FDECEA; color: #D93026; }

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.dot.t-rose { background: #B8506A; }
.dot.t-red { background: #B3212B; }
.dot.t-champ { background: #C9A227; }
.dot.t-black { background: #14100C; }
.dot.t-moon { background: linear-gradient(135deg, #8A1622 0%, #E9C66B 100%); }

.op { color: #1677FF; cursor: pointer; margin-right: 12px; font-size: 14px; white-space: nowrap; }
.op:hover { text-decoration: underline; }
.op.danger { color: #D93026; }

.empty { padding: 70px 0; text-align: center; color: #B4BAC3; font-size: 14px; }

/* ---------- 登录 ---------- */
.login-box {
  width: 360px; margin: 14vh auto 0;
  background: #fff; border: 1px solid #E5E8EC; border-radius: 8px;
  padding: 32px 30px 26px; text-align: center;
}
.login-box h1 { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.login-box p { font-size: 13px; color: #8B929A; margin-bottom: 22px; }
.login-box input {
  width: 100%; height: 38px; padding: 0 12px; text-align: center;
  border: 1px solid #D9DEE5; border-radius: 4px; font-size: 15px;
  font-family: inherit; outline: none;
}
.login-box input:focus { border-color: #1677FF; }
.login-box button {
  width: 100%; height: 38px; margin-top: 14px;
  border: none; border-radius: 4px; background: #1677FF; color: #fff;
  font-size: 15px; font-family: inherit; cursor: pointer;
}
.login-box .tip { font-size: 13px; color: #D93026; min-height: 20px; margin-top: 12px; }

/* ---------- 新增弹窗 ---------- */
.mask {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0, 0, 0, .45);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.mask[hidden] { display: none !important; }
.modal {
  width: 780px; max-width: 100%; max-height: 90vh;
  background: #fff; border-radius: 10px;
  display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
}
.modal-head {
  padding: 18px 24px; border-bottom: 1px solid #E5E8EC;
  display: flex; align-items: center;
  flex: 0 0 auto;
}
.modal-head h3 { font-size: 16px; font-weight: 600; }
.modal-head .close {
  margin-left: auto; font-size: 20px; color: #8B929A;
  cursor: pointer; line-height: 1; padding: 4px;
}
/* 关键：flex 子项默认 min-height:auto 会被内容撑开，导致头部被压扁、底部按钮飞出 */
.modal-body {
  padding: 20px 24px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}
.modal-foot {
  padding: 14px 24px; border-top: 1px solid #E5E8EC;
  display: flex; justify-content: flex-end; gap: 10px;
  flex: 0 0 auto;
  background: #fff;
}

.row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 24px; margin-bottom: 18px; }
.row.full { grid-template-columns: 1fr; }
.field label { display: block; font-size: 13px; color: #4E5969; margin-bottom: 6px; }
.field label .req { color: #D93026; margin-left: 2px; }
.field input, .field textarea, .field select {
  width: 100%; border: 1px solid #D9DEE5; border-radius: 4px;
  padding: 8px 10px; font-size: 14px; font-family: inherit;
  color: #1F2329; outline: none;
}
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: #1677FF; box-shadow: 0 0 0 2px rgba(22,119,255,.1);
}
.field textarea { min-height: 132px; resize: vertical; line-height: 1.7; }
.field .counter { float: right; font-size: 12px; color: #B4BAC3; font-weight: 400; }
.hint { font-size: 12px; color: #8B929A; margin-top: 6px; line-height: 1.6; }
.hint.bad { color: #D93026; }
.hint.ok { color: #1A7F4B; }

.seg { display: flex; gap: 8px; }
.seg-item {
  flex: 1; height: 34px; border: 1px solid #D9DEE5; border-radius: 4px;
  background: #fff; font-size: 13px; font-family: inherit;
  color: #4E5969; cursor: pointer;
}
.seg-item.on { border-color: #1677FF; background: #F0F6FF; color: #1677FF; font-weight: 500; }

.themes { display: flex; gap: 10px; }
.theme-opt {
  flex: 1; border: 1px solid #D9DEE5; border-radius: 4px;
  padding: 0 6px; height: 34px; white-space: nowrap; justify-content: center;
  display: flex; align-items: center; gap: 7px;
  font-size: 13px; color: #4E5969; cursor: pointer;
}
.theme-opt.on { border-color: #1677FF; background: #F0F6FF; color: #1677FF; }

/* 生成结果提示 */
.result {
  margin-top: 4px; padding: 14px 16px;
  background: #F0F9F4; border: 1px solid #B7E4C7; border-radius: 6px;
}
.result .link { font-size: 13px; color: #1A7F4B; word-break: break-all; margin-bottom: 10px; }
.result .acts { display: flex; gap: 10px; }
.result .acts .btn { height: 30px; padding: 0 14px; font-size: 13px; }

/* 查看明细 */
.v-stat { font-size: 14px; color: #4E5969; margin-bottom: 14px; }
.v-stat b { font-size: 17px; color: #1F2329; margin: 0 2px; }
.v-stat b.ok { color: #1A7F4B; }
.v-stat b.warn { color: #D93026; }
.v-table-wrap { max-height: 46vh; overflow-y: auto; border: 1px solid #E5E8EC; border-radius: 6px; }
.v-table-wrap thead th { position: sticky; top: 0; z-index: 2; }

/* 编辑弹窗顶部警示（单行） */
.edit-warn {
  flex-shrink: 0;
  background: #FFF3F1;
  border-left: 3px solid #D93026;
  border-radius: 2px;
  padding: 9px 12px;
  margin-bottom: 18px;
  font-size: 13px;
  line-height: 1.6;
  color: #C0271B;
}

/* 分页 */
.pager {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 6px; padding: 14px 24px;
  border-top: 1px solid #E5E8EC;
}
.pager:empty { display: none; }
.pager-info { font-size: 13px; color: #8B929A; margin-right: 8px; }
.pager-btn {
  min-width: 32px; height: 32px; padding: 0 10px;
  border: 1px solid #D9DEE5; border-radius: 4px;
  background: #fff; color: #1F2329;
  font-size: 13px; font-family: inherit; cursor: pointer;
}
.pager-btn:hover:not(:disabled):not(.on) { border-color: #1677FF; color: #1677FF; }
.pager-btn.on { background: #1677FF; border-color: #1677FF; color: #fff; cursor: default; }
.pager-btn:disabled { color: #C4C9D0; cursor: not-allowed; background: #FAFBFC; }
.pager-dots { color: #B4BAC3; padding: 0 2px; }

/* 轻提示 */
.toast {
  position: fixed;
  left: 50%; top: 28px;
  transform: translateX(-50%) translateY(-8px);
  padding: 10px 20px;
  background: rgba(31, 35, 41, .92);
  color: #fff;
  font-size: 14px;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 300;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 表单提示：固定占位，避免出现/消失时弹窗跳动 */
#m-err {
  min-height: 18px;
  margin-top: 4px;
  font-size: 12.5px;
  line-height: 1.5;
}

/* ============================================================
   侧边栏与多模块（后台只面向 PC）
   ============================================================ */
#app { padding-left: 176px; }

.side {
  position: fixed; left: 0; top: 0; bottom: 0; width: 176px;
  background: #1F2937; color: #CBD5E1;
  display: flex; flex-direction: column; z-index: 50;
}
.side-brand {
  height: 54px; display: flex; align-items: center; padding: 0 18px;
  font-size: 13.5px; font-weight: 600; color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.08); letter-spacing: .5px;
}
.side-nav { padding: 10px 8px; flex: 1; }
.side-item {
  display: block; padding: 10px 14px; border-radius: 6px;
  font-size: 13.5px; color: #CBD5E1; cursor: pointer;
  margin-bottom: 2px; transition: background .12s, color .12s;
  text-decoration: none;
}
.side-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.side-item.active { background: #2563EB; color: #fff; }
.side-foot { padding: 12px; border-top: 1px solid rgba(255,255,255,.08); }
.side-foot .btn {
  width: 100%; background: transparent; color: #CBD5E1;
  border: 1px solid rgba(255,255,255,.22);
}
.side-foot .btn:hover { background: rgba(255,255,255,.08); color: #fff; }

/* 模块头 */
.mod-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px; border-bottom: 1px solid #EEF0F3;
}
.mod-head h2 { font-size: 15px; font-weight: 600; margin: 0; }
.mod-sub { font-size: 12.5px; color: #8B929A; margin: 4px 0 0; }

/* 列表行 */
.slist-head,
.slist-row {
  display: grid; gap: 12px; padding: 11px 20px;
  font-size: 13px; align-items: center;
}
.slist-head { color: #8B929A; font-size: 12px; border-bottom: 1px solid #EEF0F3; }
.slist-row { border-bottom: 1px solid #F4F6F8; }
.slist-row:hover { background: #FAFBFC; }
.slist-row .t { font-weight: 500; color: #1F2937; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slist-row .d { color: #6B7280; }
.slist-row .acts { display: flex; gap: 6px; justify-content: flex-end; }
.slist-row .acts .btn { padding: 4px 10px; font-size: 12.5px; }
.blank { padding: 40px 20px; text-align: center; color: #9CA3AF; font-size: 13px; }
