* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; background: #f4f5f7; color: #222; }
.hidden { display: none !important; }
.primary { background: #2689FF; color: #fff; border: none; border-radius: 6px; cursor: pointer; }
button { font-size: 14px; padding: 7px 14px; border: 1px solid #ddd; background: #fff; border-radius: 6px; cursor: pointer; }
button:hover { border-color: #2689FF; color: #2689FF; }
.primary:hover { color: #fff; border-color: #2689FF; filter: brightness(1.05); }

/* 登录 */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg,#4d9bff,#1a6fe8); }
.login .card { background: #fff; padding: 34px 30px; border-radius: 14px; width: 320px; box-shadow: 0 10px 40px rgba(0,0,0,.2); }
.login h1 { font-size: 20px; margin-bottom: 20px; text-align: center; }
.login input { width: 100%; padding: 11px 12px; border: 1px solid #ddd; border-radius: 8px; margin-bottom: 14px; font-size: 15px; }
.login .primary { width: 100%; padding: 11px; font-size: 15px; }
.login .hint { font-size: 12px; color: #999; text-align: center; margin-top: 10px; }
code { background: #f0f0f0; padding: 1px 5px; border-radius: 4px; }

/* 顶栏 */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 14px 22px; background: #fff; border-bottom: 1px solid #ececec; position: sticky; top: 0; z-index: 10; }
.brand { font-weight: 700; font-size: 17px; }
.tools { display: flex; gap: 10px; }

/* 列表 */
.list { padding: 20px; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.act-card { background: #fff; border: 1px solid #ececec; border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.thumb { height: 150px; background: #f3f3f3; display: flex; align-items: center; justify-content: center; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.noimg { color: #bbb; font-size: 13px; }
.meta { padding: 12px 14px; flex: 1; display: flex; flex-direction: column; }
.meta .t { font-weight: 600; font-size: 15px; margin-bottom: 6px; line-height: 1.4; }
.meta .s { color: #999; font-size: 12px; margin-bottom: 10px; }
.meta .acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; }
.meta .acts .preview { font-size: 13px; padding: 7px 12px; background: #eef3ff; color: #3a6df0; border-radius: 6px; border: none; cursor: pointer; }
.meta .acts .preview:hover { background: #dbe9ff; }
.empty { color: #999; padding: 40px; text-align: center; grid-column: 1/-1; }

/* 编辑器 */
.editor { max-width: 1080px; margin: 0 auto; padding: 18px 20px 60px; }
.ed-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 10px; }
.ed-head h2 { font-size: 18px; }
.ed-body label { display: block; font-weight: 600; margin: 16px 0 6px; font-size: 14px; }
.ed-body input, .ed-body textarea { width: 100%; padding: 10px 12px; border: 1px solid #ddd; border-radius: 8px; font-size: 14px; font-family: inherit; }
.ed-body textarea { resize: vertical; }
.upload-row { display: flex; gap: 8px; }
.upload-row input { flex: 1; }
.upload-row .up { flex: 0 0 auto; white-space: nowrap; }
.info-fields { display: flex; flex-direction: column; gap: 8px; margin-bottom: 4px; }
.info-field { display: flex; align-items: center; gap: 10px; }
.info-field .if-label { flex: 0 0 68px; font-size: 13px; color: #666; text-align: right; }
.info-field input { flex: 1; padding: 8px 12px; border: 1px solid #ddd; border-radius: 8px; font-size: 14px; }
.prev { max-width: 200px; max-height: 140px; margin-top: 8px; border-radius: 6px; border: 1px solid #eee; }
.sec-head { margin: 22px 0 10px; font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 10px; }
.sec-head button { font-size: 13px; padding: 4px 10px; }
.blk { border: 1px solid #eee; border-radius: 8px; padding: 10px; margin-bottom: 10px; display: flex; flex-direction: column; gap: 8px; }
.blk-head { display: flex; align-items: center; justify-content: space-between; }
.blk .bt { font-size: 12px; color: #2689FF; font-weight: 700; }
.blk-ops { display: flex; gap: 6px; }
.blk-ops .mv, .blk-ops .rm { font-size: 12px; padding: 3px 9px; line-height: 1.4; }
.text-tools { display: flex; align-items: center; gap: 3px; flex-wrap: wrap; padding: 5px 6px; background: #f6f7f9; border: 1px solid #e8eaee; border-radius: 6px; }
.tbtn { width: 30px; height: 28px; display: flex; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 4px; background: transparent; cursor: pointer; color: #444; font-size: 14px; padding: 0; line-height: 1; }
.tbtn:hover { background: #e9edf2; }
.tbtn.on { background: #dbe9ff; color: #2689FF; border-color: #bcd6ff; }
.tsep { width: 1px; height: 18px; background: #d9dde3; margin: 0 4px; flex: 0 0 auto; }
.tselect { display: flex; align-items: center; gap: 3px; font-size: 12px; color: #666; }
.tselect select { padding: 3px 5px; border: 1px solid #d9dde3; border-radius: 4px; font-size: 12px; background: #fff; color: #333; }
.tcolor { display: flex; align-items: center; gap: 3px; cursor: pointer; }
.tcolor-a { font-weight: 700; color: #666; font-size: 14px; line-height: 1; }
.tcolor input[type=color] { width: 24px; height: 24px; padding: 0; border: 1px solid #d9dde3; border-radius: 4px; cursor: pointer; background: #fff; }
#rewards .rw { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
#rewards .rw input { flex: 1; }
#rewards .rw .th { flex: 0 0 90px; }
#rewards .rw .rm { flex: 0 0 auto; }
.share-box { margin-top: 24px; padding: 12px 14px; background: #f7f8fa; border-radius: 8px; font-size: 13px; }
.share-box code { display: inline-block; max-width: 70%; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }

/* OSS 设置 */
.oss-status { padding: 10px 14px; border-radius: 8px; font-size: 14px; margin-bottom: 18px; font-weight: 600; }
.oss-status.on { background: #e8f7ee; color: #1a9e54; }
.oss-status.off { background: #fff5e8; color: #d98300; }
.oss-actions { display: flex; align-items: center; gap: 12px; margin: 18px 0 8px; }
.oss-msg { font-size: 13px; }
.oss-msg.ok { color: #1a9e54; }
.oss-msg.err { color: #d93434; }

.toast { position: fixed; right: 24px; top: 72px; display: flex; align-items: center; gap: 9px; background: #fff; padding: 11px 16px; border-radius: 8px; font-size: 14px; box-shadow: 0 8px 28px rgba(0,0,0,.14); border: 1px solid #eef1f5; z-index: 100; opacity: 0; transform: translateX(120%); transition: transform .28s ease, opacity .28s ease; pointer-events: none; max-width: 340px; }
.toast.show { opacity: 1; transform: translateX(0); }
.toast-ic { width: 18px; height: 18px; border-radius: 50%; color: #fff; font-size: 12px; line-height: 18px; text-align: center; background: #1a9e54; flex: 0 0 auto; }
.toast.err .toast-ic { background: #d93434; }

/* 预览二维码弹窗 */
.qr-modal { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; z-index: 200; }
.qr-card { background: #fff; border-radius: 12px; padding: 24px 28px; width: 300px; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.2); }
.qr-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; font-weight: 700; font-size: 15px; }
.qr-close { border: none; background: transparent; font-size: 22px; cursor: pointer; color: #999; line-height: 1; padding: 0; }
.qr-box { display: flex; justify-content: center; margin: 0 auto 14px; min-height: 200px; }
.qr-box img, .qr-box canvas { display: block; }
.qr-url { font-size: 12px; color: #888; word-break: break-all; margin-bottom: 16px; background: #f5f6f8; padding: 8px 10px; border-radius: 6px; }
.qr-actions { display: flex; gap: 14px; justify-content: center; align-items: center; }
.qr-open { font-size: 14px; color: #2689FF; text-decoration: none; }
.qr-open:hover { text-decoration: underline; }

/* 编辑器布局：手机 fixed 左侧垂直居中预览 + 编辑区居中 */
.ed-grid { display: block; }
.ed-preview { position: fixed; left: calc(50vw - 592px); top: 50%; transform: translateY(-50%); z-index: 40; }
.ed-form { max-width: 560px; margin: 0 auto; }

/* 预览标签 */
.pv-badge { position: absolute; top: -40px; left: 50%; transform: translateX(-50%); background: #2689FF; color: #fff; font-size: 13px; font-weight: 700; letter-spacing: .04em; padding: 5px 18px; border-radius: 999px; box-shadow: 0 4px 14px rgba(38,137,255,.35); z-index: 5; white-space: nowrap; }
.pv-badge::after { content: ''; position: absolute; left: 50%; bottom: -5px; transform: translateX(-50%); width: 0; height: 0; border-left: 6px solid transparent; border-right: 6px solid transparent; border-top: 6px solid #2689FF; }

/* 手机模型（复刻中城易佰官网 device-phone） */
.device-phone { position: relative; width: 272px; height: 558px; background: #0f172a; border-radius: 42px; padding: 11px; box-shadow: 0 28px 56px rgba(15,23,42,.28); }
.device-notch { position: absolute; top: 11px; left: 50%; transform: translateX(-50%); width: 112px; height: 23px; background: #0f172a; border-radius: 0 0 16px 16px; z-index: 3; }
.device-screen { position: absolute; inset: 11px; border-radius: 32px; background: #fff; overflow: hidden; }
#phonePreview { width: 100%; height: 100%; overflow-y: auto; background: #fff; scrollbar-width: none; }
#phonePreview::-webkit-scrollbar { display: none; }

/* 手机屏内 H5 预览 */
#phonePreview .pv-poster img { width: 100%; display: block; }
#phonePreview .pv-body { padding: 13px 15px 24px; }
#phonePreview .pv-title { font-size: 16px; font-weight: 700; line-height: 1.42; margin-bottom: 10px; color: #1a1a1a; }
#phonePreview .pv-para { font-size: 13px; line-height: 1.85; color: #333; margin-bottom: 10px; white-space: pre-wrap; }
#phonePreview .pv-img { margin-bottom: 10px; line-height: 0; }
#phonePreview .pv-img img { width: 100%; display: block; border-radius: 6px; }
#phonePreview .pv-contact { margin-top: 10px; padding: 10px 12px; background: #f5f6f8; border-radius: 8px; font-size: 12px; color: #555; white-space: pre-wrap; line-height: 1.7; }
#phonePreview .pv-info { margin-top: 10px; background: #f7f9fc; border: 1px solid #eef1f6; border-radius: 9px; padding: 2px 12px; }
#phonePreview .pv-info-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid #eef1f6; font-size: 12px; color: #333; }
#phonePreview .pv-info-row:last-child { border-bottom: none; }
#phonePreview .pv-info-ic { width: 14px; height: 14px; color: #2689FF; flex: 0 0 auto; display: flex; align-items: center; }
#phonePreview .pv-info-ic svg { width: 100%; height: 100%; }
#phonePreview .pv-info-map { margin: 0 0 6px; line-height: 0; }
#phonePreview .pv-info-map img { width: 100%; display: block; border-radius: 6px; }
#phonePreview .pv-empty { color: #c3c3c3; text-align: center; padding: 52px 20px; font-size: 13px; line-height: 1.9; }
#phonePreview .pv-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-bottom: 10px; padding-bottom: 9px; border-bottom: 1px solid #f0f0f0; font-size: 11px; color: #9a9a9a; }
.pv-views { position: absolute; left: 10px; bottom: 10px; background: rgba(0,0,0,.5); color: #fff; font-size: 10px; line-height: 1; padding: 5px 9px; border-radius: 12px; z-index: 3; pointer-events: none; }
.pv-views b { font-weight: 700; }

@media (max-width: 1280px) {
  .ed-preview { display: none; }
}
