* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f2f4f8;
  color: #1f2329;
}

/* 启动占位 */
.boot { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100vh; color: #8a94a6; gap: 14px; }
.boot-spin { width: 34px; height: 34px; border: 3px solid #dfe4ec; border-top-color: #2f6fed; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 顶栏 */
.topbar {
  height: 60px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 22px; background: #fff; box-shadow: 0 1px 0 #e8ecf3; position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 600; letter-spacing: .5px; }
.brand-logo {
  width: 32px; height: 32px; border-radius: 9px; background: linear-gradient(135deg, #2f6fed, #6aa4ff);
  color: #fff; display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 700;
}
.brand small { font-size: 12px; color: #9aa3af; font-weight: 400; margin-left: 2px; }
.top-right { display: flex; align-items: center; gap: 14px; font-size: 14px; color: #4b5563; }
.who { display: flex; align-items: center; gap: 8px; }
.who-dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; }

/* 主体三栏 */
.layout { display: grid; grid-template-columns: 168px minmax(0, 1fr) 392px; gap: 18px; padding: 18px 22px 40px; align-items: start; }
.side { background: #fff; border-radius: 14px; padding: 10px; box-shadow: 0 2px 12px rgba(31, 41, 55, .05); position: sticky; top: 78px; }
.side-item { padding: 10px 14px; border-radius: 10px; font-size: 14px; color: #4b5563; cursor: pointer; display: flex; align-items: center; gap: 9px; }
.side-item:hover { background: #f5f7fb; }
.side-item.on { background: #eaf1ff; color: #2f6fed; font-weight: 600; }
.side-tip { font-size: 12px; color: #a3abba; padding: 12px 14px 6px; line-height: 1.7; }

.panel { background: #fff; border-radius: 14px; padding: 20px 22px 24px; box-shadow: 0 2px 12px rgba(31, 41, 55, .05); min-height: 420px; }
.panel h3 { margin: 0 0 4px; font-size: 16px; }
.panel .desc { margin: 0 0 18px; font-size: 13px; color: #9099a8; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.field-grid .full { grid-column: 1 / -1; }

/* 预览（手机壳） */
.preview-col { position: sticky; top: 78px; }
.phone {
  background: #fff; border-radius: 14px; padding: 12px; box-shadow: 0 2px 12px rgba(31, 41, 55, .05);
}
.phone-title { font-size: 13px; color: #6b7280; margin: 2px 0 10px; display: flex; justify-content: space-between; align-items: center; }
.phone-frame {
  border: 10px solid #1f2329; border-radius: 30px; overflow: hidden; background: #f4f6fa; height: 620px; position: relative;
}
.phone-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.share-box { margin-top: 14px; background: #fff; border-radius: 14px; padding: 16px; box-shadow: 0 2px 12px rgba(31, 41, 55, .05); }
.share-row { display: flex; gap: 8px; margin-top: 10px; }
.qr-wrap { display: flex; gap: 14px; align-items: center; margin-top: 12px; }
#qrcode, #qrcode img, #qrcode canvas { width: 108px; height: 108px; }
.qr-tip { font-size: 12px; color: #9099a8; line-height: 1.8; }

/* 模板选择 */
.tpl-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.tpl {
  border: 2px solid #eceff4; border-radius: 12px; padding: 8px 8px 10px; cursor: pointer; text-align: center; transition: .18s;
}
.tpl:hover { border-color: #bcd2ff; }
.tpl.on { border-color: #2f6fed; box-shadow: 0 0 0 3px rgba(47, 111, 237, .12); }
.tpl-prev { height: 84px; border-radius: 8px; margin-bottom: 8px; position: relative; overflow: hidden; }
.tpl-prev i { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); width: 26px; height: 26px; border-radius: 50%; background: rgba(255, 255, 255, .85); }
.tpl-prev b { position: absolute; left: 50%; top: 44px; transform: translateX(-50%); width: 46px; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .9); }
.tpl-prev u { position: absolute; left: 14px; right: 14px; top: 58px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .55); }
.tpl-prev u + u { top: 68px; }
.tpl-name { font-size: 12px; color: #4b5563; }
.tpl-c { background: linear-gradient(160deg, #eaf1ff, #fff); }
.tpl-c i, .tpl-c b, .tpl-c u { background: rgba(47, 111, 237, .45); }
.tpl-m { background: linear-gradient(135deg, #2f6fed, #6aa4ff); }
.tpl-d { background: linear-gradient(135deg, #0f172a, #23304a); }
.tpl-d i, .tpl-d b, .tpl-d u { background: rgba(148, 163, 184, .5); }
.tpl-g { background: linear-gradient(135deg, #7c3aed, #2f6fed); }

.color-grid { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.color-dot { width: 26px; height: 26px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; box-shadow: 0 1px 4px rgba(0, 0, 0, .16); }
.color-dot.on { border-color: #1f2329; }

/* 上传区 */
.up-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.up-item { border: 1px dashed #d6dce6; border-radius: 12px; padding: 12px; }
.up-item .t { font-size: 13px; color: #4b5563; margin-bottom: 10px; }
.up-box {
  width: 100%; height: 130px; border: 1px dashed #d6dce6; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; overflow: hidden; background: #fafbfd; color: #9aa3af; font-size: 12px; position: relative;
}
.up-box:hover { border-color: #2f6fed; color: #2f6fed; }
.up-box img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.up-actions { margin-top: 8px; display: flex; gap: 8px; }

/* 登录页 */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: linear-gradient(135deg, #eef3ff, #f7f8fc 55%, #eef7ff); }
.login-card { width: 100%; max-width: 420px; background: #fff; border-radius: 18px; padding: 30px 32px 26px; box-shadow: 0 18px 50px rgba(31, 41, 55, .1); }
.login-head { text-align: center; margin-bottom: 22px; }
.login-head .brand-logo { width: 46px; height: 46px; font-size: 21px; border-radius: 13px; margin: 0 auto 12px; }
.login-head h2 { margin: 0; font-size: 20px; }
.login-head p { margin: 6px 0 0; font-size: 13px; color: #9099a8; }
.login-foot { text-align: center; font-size: 12px; color: #a3abba; margin-top: 16px; line-height: 1.8; }

.save-bar { display: flex; gap: 10px; margin-top: 22px; padding-top: 18px; border-top: 1px solid #eef1f6; }

@media (max-width: 1180px) {
  .layout { grid-template-columns: 1fr; }
  .side { position: static; display: flex; gap: 8px; overflow-x: auto; }
  .side-tip { display: none; }
  .preview-col { position: static; }
  .phone-frame { height: 560px; }
}

/* 推荐案例 / 推荐产品 编辑器 */
.mod-edit {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 14px; margin-bottom: 14px;
  border: 1px solid #eef1f6; border-radius: 12px; background: #fafbfd;
  position: relative;
}
.me-img {
  flex: 0 0 120px; width: 120px; height: 96px; border-radius: 10px; overflow: hidden;
  background: #eef1f6; display: flex; align-items: center; justify-content: center;
  text-align: center; font-size: 12px; color: #98a2b3; cursor: pointer; border: 1px dashed #d6dce6;
}
.me-img:hover { border-color: #2f6fed; color: #2f6fed; }
.me-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.me-fields { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.me-del { flex: 0 0 auto; align-self: flex-start; }

/* 图片展示 编辑器 */
.gal-edit { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; margin-bottom: 14px; }
.gal-item { display: flex; flex-direction: column; gap: 8px; }
.gal-box {
  width: 100%; aspect-ratio: 4/3; border-radius: 10px; overflow: hidden;
  background: #eef1f6; display: flex; align-items: center; justify-content: center;
  text-align: center; font-size: 12px; color: #98a2b3; cursor: pointer; border: 1px dashed #d6dce6;
}
.gal-box:hover { border-color: #2f6fed; color: #2f6fed; }
.gal-box img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* 名片夹（多名片） */
.cardbar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: #fff; border-bottom: 1px solid #eef0f4; padding: 10px 22px;
}
.cb-label { font-size: 13px; color: #6b7280; white-space: nowrap; }
.cb-chips { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cb-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px 5px 12px;
  border: 1px solid #e2e6ee; border-radius: 999px; background: #f7f9fc; cursor: pointer; font-size: 13px; color: #374151;
  transition: .15s;
}
.cb-chip:hover { border-color: #bcd0ff; }
.cb-chip.on { background: #eaf1ff; border-color: #2f6fed; color: #1d4ed8; font-weight: 600; }
.cb-name { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cb-def { font-size: 11px; background: #2f6fed; color: #fff; border-radius: 999px; padding: 1px 7px; }
.cb-more { color: #9aa3af; padding: 0 2px; font-weight: 700; }
.cb-more:hover { color: #1d4ed8; }
.cb-add {
  border: 1px dashed #c3cee0; background: #fff; color: #2f6fed; border-radius: 999px;
  padding: 5px 14px; font-size: 13px; cursor: pointer;
}
.cb-add:hover { background: #f0f6ff; border-color: #2f6fed; }

/* 访问数据 */
.stat-cards { display: flex; gap: 14px; margin: 4px 0 18px; flex-wrap: wrap; }
.stat-box {
  flex: 1; min-width: 120px; background: #f7f9fc; border: 1px solid #eef0f4; border-radius: 12px;
  padding: 16px; text-align: center;
}
.stat-n { font-size: 26px; font-weight: 700; color: #1f2329; }
.stat-l { font-size: 12px; color: #9099a8; margin-top: 4px; }
.trend { display: flex; flex-direction: column; gap: 8px; }
.trend-row { display: flex; align-items: center; gap: 10px; }
.trend-day { width: 42px; font-size: 12px; color: #9099a8; text-align: right; }
.trend-bar-wrap { flex: 1; display: flex; align-items: center; gap: 8px; }
.trend-bar { height: 14px; min-width: 4px; border-radius: 7px; transition: width .3s; background: #2f6fed; }
.trend-val { font-size: 12px; color: #6b7280; }
.visit-list { display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow: auto; }
.visit-item { border: 1px solid #eef0f4; border-radius: 10px; padding: 8px 12px; background: #fafbfd; }
.visit-main { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.visit-ua { color: #374151; font-weight: 600; }
.visit-ip { color: #9099a8; font-size: 12px; }
.visit-sub { font-size: 12px; color: #9099a8; margin-top: 2px; word-break: break-all; }
.visit-empty { font-size: 13px; color: #a3abba; padding: 10px 0; }
.slug-prefix { font-size: 13px; color: #9099a8; background: #f3f5f9; padding: 6px 8px; border-radius: 6px; }
