/* 碰一碰评价助手 · 后台样式 */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: #f5f6f8;
  color: #1f2329;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: #f2f3f5; padding: 2px 6px; border-radius: 4px; font-size: 12px; word-break: break-all; }
h1, h2, h3 { margin: 0; }
.danger { color: #dc2626; }
.muted { color: #6b7280; font-size: 13px; line-height: 1.7; }
.right { text-align: right; }
.block { display: block; width: 100%; }
.inline { display: inline-block; margin: 0; }

/* 布局 */
.layout { display: flex; min-height: 100vh; }
.side {
  width: 210px; flex: 0 0 210px; background: #1d2129; color: #cbd2dc;
  display: flex; flex-direction: column; padding: 16px 12px;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 9px; padding: 4px 6px 18px; }
.blogo {
  width: 30px; height: 30px; border-radius: 9px; background: #e8541e; color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px;
}
.bname { color: #fff; font-weight: 600; font-size: 14px; }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; }
.navi {
  color: #cbd2dc; padding: 9px 12px; border-radius: 8px; font-size: 14px; text-decoration: none;
}
.navi:hover { background: rgba(255,255,255,.07); text-decoration: none; }
.navi.active { background: #e8541e; color: #fff; font-weight: 600; }
.side-foot { display: flex; flex-direction: column; gap: 4px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.1); }
.side-foot a { color: #8b94a3; font-size: 13px; padding: 4px 6px; }

.main { flex: 1 1 auto; min-width: 0; padding: 20px 24px 60px; }
.topbar { margin-bottom: 16px; }
.topbar h1 { font-size: 20px; font-weight: 700; }

/* 卡片 */
.card {
  background: #fff; border-radius: 14px; padding: 18px;
  box-shadow: 0 1px 3px rgba(20,25,40,.05); margin-bottom: 14px;
}
.card h2 { font-size: 16px; margin-bottom: 12px; font-weight: 700; }
.card h3 { font-size: 14px; margin: 14px 0 8px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head h2 { margin-bottom: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

/* KPI */
.kpi { text-align: center; padding: 16px 10px; }
.kpi .n { font-size: 26px; font-weight: 700; color: #1f2329; line-height: 1.2; }
.kpi .n .u { font-size: 14px; margin-left: 2px; color: #6b7280; }
.kpi .l { font-size: 12px; color: #6b7280; margin-top: 4px; }

/* 表单 */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 13px; color: #374151; font-weight: 600; margin-bottom: 6px; }
.field input[type=text], .field input[type=password], .field input[type=number],
.field select, .field textarea {
  width: 100%; border: 1px solid #e5e7eb; border-radius: 9px; padding: 9px 11px;
  font-size: 14px; background: #fff; font-family: inherit; color: #1f2329;
}
.field textarea { resize: vertical; line-height: 1.7; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid rgba(37,99,235,.15); border-color: #2563eb;
}
.field input[type=color] { width: 60px; height: 38px; padding: 2px; border: 1px solid #e5e7eb; border-radius: 8px; background: #fff; }
.field .hint { display: block; font-style: normal; font-size: 12px; color: #9ca3af; margin-top: 5px; line-height: 1.6; }
.field .hint.warn-text { color: #b45309; background: #fffbeb; border-radius: 6px; padding: 6px 8px; margin-top: 8px; }
.check { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 12px; font-size: 13px; color: #374151; }
.check input { margin-top: 4px; }
.logo-preview { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; margin-bottom: 8px; border: 1px solid #eee; }
.pfbox { border: 1px solid #eef0f3; border-radius: 10px; padding: 12px; margin-bottom: 12px; background: #fcfcfd; }
.pfbox h3 { margin-top: 0; }

/* 自定义入口 */
.erow { display: grid; grid-template-columns: 46px 130px 1fr 96px 64px; gap: 8px; align-items: center; margin-bottom: 8px; }
.erow input[type=text], .erow select {
  width: 100%; border: 1px solid #e5e7eb; border-radius: 8px; padding: 8px 10px;
  font-size: 13px; font-family: inherit; background: #fff; color: #1f2329;
}
.erow input[type=text]:focus, .erow select:focus { outline: 2px solid rgba(37,99,235,.15); border-color: #2563eb; }
.erow-icon {
  position: relative; width: 40px; height: 40px; border-radius: 10px; background: #f3f4f6;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  cursor: pointer; border: 1px dashed #d1d5db;
}
.erow-icon input { position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.erow-icon img { width: 100%; height: 100%; object-fit: cover; }
.erow-icon span { color: #9ca3af; font-size: 16px; }

/* 平台头像 */
.icon-line { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.icon-prev {
  position: relative; width: 52px; height: 52px; border-radius: 14px; background: #f3f4f6;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  cursor: pointer; flex: 0 0 auto; border: 1px dashed #d1d5db;
}
.icon-prev input { position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.icon-img { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.icon-img img { width: 100%; height: 100%; object-fit: cover; }
.icon-img i { font-style: normal; font-weight: 700; color: #6b7280; font-size: 18px; }
.icon-tx { flex: 1 1 auto; min-width: 0; }
.icon-tx b { display: block; font-size: 13px; }
.icon-tx em { display: block; font-style: normal; font-size: 12px; color: #9ca3af; line-height: 1.6; margin-top: 2px; }
@media (max-width: 720px) {
  .erow { grid-template-columns: 46px 1fr 1fr; }
  .erow input[name="entry_link[]"] { grid-column: 2 / -1; }
}

/* 按钮 */
.btn {
  display: inline-block; border: 0; border-radius: 9px; padding: 9px 16px;
  font-size: 14px; font-weight: 600; cursor: pointer; text-align: center;
  background: #f3f4f6; color: #374151; text-decoration: none; line-height: 1.4;
  font-family: inherit;
}
.btn:hover { text-decoration: none; opacity: .92; }
.btn.primary { background: #e8541e; color: #fff; }
.btn.ghost { background: #fff; color: #374151; border: 1px solid #e5e7eb; }
.btn.danger { background: #fee2e2; color: #dc2626; }
.btn.small { padding: 5px 11px; font-size: 13px; border-radius: 8px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row .btn { min-width: 110px; }

/* 提示条 */
.flash { border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; font-size: 13px; }
.flash.ok { background: #ecfdf5; color: #047857; }
.flash.err { background: #fef2f2; color: #b91c1c; }
.flash.warn { background: #fffbeb; color: #b45309; }

/* 表格 */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { padding: 9px 8px; border-bottom: 1px solid #f0f1f3; text-align: left; vertical-align: middle; }
.table th { color: #6b7280; font-weight: 600; font-size: 12px; background: #fafbfc; }
.table td.txt { color: #4b5563; line-height: 1.6; }
.table tr:last-child td { border-bottom: 0; }
.sub2 { font-size: 12px; color: #9ca3af; margin-top: 2px; }
.sub2 a { color: #2563eb; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; }
.pill.on { background: #ecfdf5; color: #047857; }
.pill.off { background: #f3f4f6; color: #6b7280; }
.empty { color: #9ca3af; font-size: 13px; padding: 18px 4px; text-align: center; }

/* 柱状图 */
.bars { display: flex; align-items: flex-end; gap: 8px; height: 130px; padding: 6px 0 0; }
.bar-col { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; }
.bar { width: 100%; max-width: 38px; height: 92px; background: #f3f4f6; border-radius: 6px; display: flex; align-items: flex-end; overflow: hidden; }
.bar i { display: block; width: 100%; background: linear-gradient(180deg,#ff9a6b,#e8541e); border-radius: 6px 6px 0 0; min-height: 2px; }
.bar-col span { font-size: 11px; color: #9ca3af; margin-top: 5px; }
.bar-col em { font-size: 11px; color: #c0c4cc; font-style: normal; }
.bars.hours { height: 110px; gap: 3px; }
.bars.hours .bar { height: 74px; }
.bars.hours .bar-col span { font-size: 10px; }

/* 漏斗 */
.funnel th { background: none; font-weight: 600; color: #374151; font-size: 13px; }
.fbar { background: #f3f4f6; border-radius: 999px; height: 10px; overflow: hidden; }
.fbar i { display: block; height: 100%; background: linear-gradient(90deg,#ffb08a,#e8541e); border-radius: 999px; }
.sub-h { margin: 18px 0 8px; font-size: 14px; }

/* 图片网格 */
.agrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.acell img { width: 100%; height: 150px; object-fit: cover; border-radius: 10px; border: 1px solid #eef0f3; display: block; margin-bottom: 6px; }
.upload-box { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.upload-box input[type=file] { font-size: 13px; }
.upload-box .hint { font-size: 12px; color: #9ca3af; flex-basis: 100%; }

/* 二维码 */
.qrpage { text-align: center; }
.qrbox { display: inline-block; padding: 12px; background: #fff; border: 1px solid #eef0f3; border-radius: 12px; margin: 8px 0 14px; min-height: 120px; min-width: 120px; }
.qrbox img { display: block; }
.qrbox canvas { display: block; }
.qrfail { color: #b91c1c; font-size: 13px; }
.qrow { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.qcode { background: #f2f3f5; padding: 6px 10px; border-radius: 6px; font-size: 12px; }
.quick { margin-top: 12px; border-top: 1px solid #f0f1f3; padding-top: 12px; }

/* 列表文字 */
.steps, .tips { margin: 0; padding-left: 20px; color: #4b5563; font-size: 13px; line-height: 2; }
.tips { list-style: disc; }
.pre { background: #f7f8fa; border: 1px solid #eef0f3; border-radius: 10px; padding: 12px; font-size: 12px; line-height: 1.7; overflow: auto; color: #374151; white-space: pre-wrap; word-break: break-all; }
.filters { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.filters select { border: 1px solid #e5e7eb; border-radius: 8px; padding: 6px 10px; font-size: 13px; background: #fff; }

/* 登录 */
.login-body { background: #f0f2f5; display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; }
.login-box { background: #fff; border-radius: 16px; padding: 28px 24px; width: 100%; max-width: 360px; box-shadow: 0 10px 30px rgba(20,25,40,.08); }
.login-box h1 { font-size: 19px; margin-bottom: 4px; }
.login-sub { color: #9ca3af; font-size: 13px; margin: 0 0 18px; }
.login-tip { color: #9ca3af; font-size: 12px; text-align: center; margin: 14px 0 0; line-height: 1.8; }
.login-box .btn { margin-top: 6px; }

/* 移动端 */
@media (max-width: 860px) {
  .layout { flex-direction: column; }
  .side { width: 100%; flex: none; height: auto; position: static; padding: 12px; }
  .brand { padding: 0 4px 10px; }
  .nav { flex-direction: row; overflow-x: auto; gap: 4px; padding-bottom: 2px; }
  .navi { white-space: nowrap; padding: 7px 12px; font-size: 13px; }
  .side-foot { flex-direction: row; gap: 14px; padding-top: 10px; }
  .main { padding: 14px 12px 50px; }
  .grid2, .grid3 { grid-template-columns: 1fr 1fr; }
  .kpi .n { font-size: 22px; }
  .table { font-size: 12px; }
  .table th, .table td { padding: 7px 5px; }
}
@media (max-width: 520px) {
  .grid3 { grid-template-columns: 1fr 1fr; }
}
