* { box-sizing: border-box; }
body {
  margin: 0; font-family: -apple-system, "Microsoft YaHei", "PingFang SC", sans-serif;
  background: #f3f5f8; color: #1f2937; font-size: 14px;
}
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 232px; background: #1e2a3a; color: #c7d2df; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { display: flex; gap: 10px; align-items: center; padding: 18px 18px 14px; border-bottom: 1px solid rgba(255,255,255,.06); }
.logo { width: 38px; height: 38px; border-radius: 9px; background: linear-gradient(135deg,#2b7de9,#12b886); display: flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; }
.brand strong { display: block; font-size: 15px; color: #fff; }
.brand small { color: #8ea0b5; font-size: 12px; }
nav { padding: 10px 10px 20px; flex: 1; }
.nav-group { margin-bottom: 14px; }
.nav-title { font-size: 12px; color: #7d8ea3; padding: 6px 10px; letter-spacing: .5px; }
.nav-item {
  display: flex; align-items: center; gap: 9px; padding: 9px 12px; border-radius: 8px;
  color: #c7d2df; text-decoration: none; font-size: 13.5px; margin-bottom: 2px;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active { background: #2b7de9; color: #fff; }
.nav-item .ico { width: 18px; text-align: center; opacity: .85; }
.sidebar-foot { padding: 14px 18px; border-top: 1px solid rgba(255,255,255,.06); font-size: 12px; color: #8ea0b5; }
.sidebar-foot a { color: #9db8d6; text-decoration: none; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { background: #fff; padding: 14px 26px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #e6ebf1; position: sticky; top: 0; z-index: 5; }
.topbar h1 { font-size: 18px; margin: 0; }
.top-right { display: flex; align-items: center; gap: 14px; color: #7c8794; font-size: 12.5px; }
.content { padding: 22px 26px 40px; flex: 1; }
.foot { text-align: center; color: #9aa6b2; font-size: 12px; padding: 16px; }

.flash { margin: 14px 26px 0; padding: 10px 14px; border-radius: 8px; background: #e7f7ef; color: #0b7a54; border: 1px solid #b8ead6; }
.flash.err { background: #fdecea; color: #b42318; border-color: #f7c8c2; }

.card { background: #fff; border-radius: 12px; box-shadow: 0 1px 2px rgba(16,24,40,.05); padding: 18px; margin-bottom: 18px; }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 10px; flex-wrap: wrap; }
.card-head h2 { font-size: 15.5px; margin: 0; }
.muted { color: #8a94a1; font-size: 12.5px; }
.small { font-size: 12.5px; color: #6b7785; }

.stats { display: grid; grid-template-columns: repeat(auto-fit,minmax(180px,1fr)); gap: 14px; margin-bottom: 18px; }
.stat { background: #fff; border-radius: 12px; padding: 16px 18px; box-shadow: 0 1px 2px rgba(16,24,40,.05); border-left: 4px solid #2b7de9; }
.stat .label { color: #7c8794; font-size: 12.5px; }
.stat .value { font-size: 24px; font-weight: 700; margin-top: 6px; letter-spacing: .5px; }
.stat .foot { text-align: left; padding: 4px 0 0; }
.stat.green { border-left-color: #12b886; }
.stat.orange { border-left-color: #f59a23; }
.stat.red { border-left-color: #e03131; }

table { width: 100%; border-collapse: collapse; }
table th { text-align: left; font-size: 12.5px; color: #6b7785; font-weight: 600; background: #f7f9fc; padding: 9px 10px; border-bottom: 1px solid #eef2f6; white-space: nowrap; }
table td { padding: 10px; border-bottom: 1px solid #f1f4f8; vertical-align: middle; }
table td.small, table th.small { font-size: 12.5px; color: #6b7785; }
.empty { padding: 34px; text-align: center; color: #98a2ae; }

.btn {
  display: inline-block; padding: 7px 13px; border-radius: 7px; border: 1px solid #2b7de9;
  background: #2b7de9; color: #fff; text-decoration: none; font-size: 13px; cursor: pointer; line-height: 1.3;
}
.btn:hover { filter: brightness(.96); }
.btn.ghost { background: #fff; color: #2b7de9; }
.btn.sm { padding: 4px 9px; font-size: 12px; }
.btn.gray { background: #fff; color: #6b7785; border-color: #d7dee6; }
.btn.danger { background: #fff; color: #d33; border-color: #f0b8b8; }
.btn.green { background: #12b886; border-color: #12b886; }
.btn.orange { background: #f59a23; border-color: #f59a23; }
.btn.block { display: block; width: 100%; text-align: center; }

input[type=text], input[type=number], input[type=password], input[type=datetime-local], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid #dbe2ea; border-radius: 7px; font-size: 13.5px; font-family: inherit; background: #fff; color: #1f2937;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: #2b7de9; box-shadow: 0 0 0 3px rgba(43,125,233,.12); }
textarea { min-height: 74px; resize: vertical; }
label.field { display: block; margin-bottom: 12px; }
label.field > span { display: block; font-size: 12.5px; color: #6b7785; margin-bottom: 5px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.grid3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 0 18px; }
.grid4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 0 18px; }
.form-actions { display: flex; gap: 10px; margin-top: 6px; flex-wrap: wrap; }

.tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.tabs a { padding: 7px 14px; border-radius: 20px; background: #fff; color: #6b7785; text-decoration: none; border: 1px solid #e3e9f0; font-size: 13px; }
.tabs a.active { background: #2b7de9; border-color: #2b7de9; color: #fff; }

.pager { display: flex; gap: 6px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.pager a { padding: 6px 11px; border-radius: 6px; background: #fff; border: 1px solid #e3e9f0; color: #5b6675; text-decoration: none; font-size: 13px; }
.pager a.active { background: #2b7de9; color: #fff; border-color: #2b7de9; }
.pager .dots { padding: 6px 4px; color: #9aa6b2; }

.tag { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; background: #eef4ff; color: #2b6cb0; }
.tag.green { background: #e6f7f0; color: #0b7a54; }
.tag.orange { background: #fff3e0; color: #b26a00; }
.tag.red { background: #fdecec; color: #c0392b; }
.tag.gray { background: #f1f3f5; color: #6b7785; }

.ad-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ad-cell { border: 1px solid #e8edf3; border-radius: 10px; overflow: hidden; background: #fff; }
.ad-cell img { width: 100%; aspect-ratio: 750/240; object-fit: cover; display: block; background: #f4f6f9; }
.ad-cell .meta { padding: 10px 12px; font-size: 12.5px; color: #6b7785; }
.ad-cell .meta strong { display: block; color: #1f2937; font-size: 13.5px; margin-bottom: 4px; }

.img-picker { display: flex; gap: 12px; align-items: flex-start; }
.img-picker .preview { width: 180px; border: 1px dashed #dbe2ea; border-radius: 8px; overflow: hidden; background: #fafbfc; }
.img-picker .preview img { width: 100%; display: block; }

.rich-wrap { border: 1px solid #dbe2ea; border-radius: 8px; overflow: hidden; background: #fff; }
.rich-toolbar { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px; border-bottom: 1px solid #eef2f6; background: #fafbfc; }
.rich-toolbar button { border: 1px solid #e0e6ee; background: #fff; border-radius: 5px; padding: 4px 9px; cursor: pointer; font-size: 12.5px; color: #4b5563; }
.rich-toolbar button:hover { border-color: #2b7de9; color: #2b7de9; }
.rich-editor { min-height: 260px; padding: 14px 16px; outline: none; line-height: 1.75; font-size: 14px; }
.rich-editor img { max-width: 100%; }
.rich-editor table { border-collapse: collapse; width: 100%; margin: 8px 0; }
.rich-editor table td, .rich-editor table th { border: 1px solid #d7dee6; padding: 6px 8px; }
.hint { font-size: 12px; color: #8a94a1; margin-top: 6px; line-height: 1.6; }

.modal-mask { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: none; align-items: center; justify-content: center; z-index: 30; padding: 20px; }
.modal-mask.show { display: flex; }
.modal { background: #fff; border-radius: 12px; width: min(720px,100%); max-height: 88vh; overflow: auto; padding: 20px; }
.modal h3 { margin: 0 0 14px; font-size: 16px; }
.modal-close { float: right; cursor: pointer; color: #8a94a1; }

.region-cascade { display: flex; gap: 8px; }
.region-cascade select { flex: 1; min-width: 0; }

@media (max-width: 980px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: relative; }
  .grid2,.grid3,.grid4 { grid-template-columns: 1fr; }
  .ad-grid { grid-template-columns: 1fr; }
}
