* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f5f6f8;
  color: #1a1a1a;
}
.hidden { display: none !important; }
.error { color: #e54d42; font-size: 13px; min-height: 18px; }

/* 登录 */
.login-view { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-card {
  width: 340px; background: #fff; border-radius: 12px; padding: 40px 32px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.08); text-align: center;
}
.login-card h1 { font-size: 22px; }
.login-card .sub { color: #888; margin: 8px 0 24px; font-size: 14px; }
.login-card input {
  width: 100%; padding: 12px 14px; margin-bottom: 14px; border: 1px solid #e0e0e0;
  border-radius: 8px; font-size: 14px; outline: none;
}
.login-card input:focus { border-color: #07c160; }
.login-card button {
  width: 100%; padding: 12px; background: #07c160; color: #fff; border: none;
  border-radius: 8px; font-size: 15px; cursor: pointer;
}

/* 顶栏 */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  background: #fff; padding: 0 32px; height: 60px; box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.brand { font-weight: 600; font-size: 16px; }
.top-actions { display: flex; gap: 12px; }

.btn-primary { background: #07c160; color: #fff; border: none; padding: 9px 18px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.btn-primary:hover { background: #06ad56; }
.btn-ghost { background: #fff; color: #555; border: 1px solid #ddd; padding: 9px 18px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.btn-ghost:hover { border-color: #bbb; }

/* 内容 */
.container { max-width: 1200px; margin: 28px auto; padding: 0 32px; }
.task-table { width: 100%; background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 2px 10px rgba(0,0,0,0.04); border-collapse: collapse; }
.task-table th, .task-table td { padding: 14px 18px; text-align: left; border-bottom: 1px solid #f0f0f0; font-size: 14px; }
.task-table th { background: #fafafa; color: #666; font-weight: 600; }
.task-table img.thumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; }
.task-table .op { display: flex; gap: 8px; }
.task-table .op button { padding: 6px 12px; border-radius: 6px; border: 1px solid #ddd; background: #fff; cursor: pointer; font-size: 13px; }
.task-table .op .del { color: #e54d42; border-color: #f3c2bd; }
.empty { text-align: center; color: #999; padding: 40px; }

/* 弹窗 */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.45); display: flex; align-items: center; justify-content: center; z-index: 50; }
.modal-card { width: 560px; max-height: 90vh; overflow: auto; background: #fff; border-radius: 12px; padding: 28px; }
.modal-card h2 { margin-bottom: 18px; font-size: 18px; }
.modal-card label { display: block; font-size: 13px; color: #555; margin-bottom: 12px; }
.modal-card input[type=text], .modal-card input[type=number], .modal-card textarea {
  width: 100%; margin-top: 6px; padding: 10px 12px; border: 1px solid #e0e0e0; border-radius: 8px; font-size: 14px; outline: none; font-family: inherit;
}
.modal-card input:focus, .modal-card textarea:focus { border-color: #07c160; }
.upload-row { display: flex; gap: 16px; margin-bottom: 12px; }
.upload-field { flex: 1; font-size: 13px; color: #555; }
.upload-field input[type=file] { margin-top: 6px; font-size: 12px; }
.preview { width: 100%; max-height: 120px; object-fit: contain; margin-top: 8px; border: 1px solid #eee; border-radius: 8px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 8px; }

.upload-section { margin-bottom: 16px; font-size: 13px; color: #555; }
.upload-section > span { display: block; margin-bottom: 6px; }
.upload-section input[type=file] { font-size: 12px; }
.image-list { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.image-item { position: relative; width: 96px; height: 96px; border: 1px solid #eee; border-radius: 8px; overflow: hidden; background: #fafafa; }
.image-item img { width: 100%; height: 100%; object-fit: cover; }
.image-actions { position: absolute; bottom: 0; left: 0; right: 0; display: flex; justify-content: space-around; background: rgba(0,0,0,0.55); padding: 4px 0; }
.image-actions button { background: transparent; border: none; color: #fff; font-size: 13px; cursor: pointer; line-height: 1; }
.image-actions button.del { color: #ff9f9f; font-size: 16px; }

/* 标签页 */
.tabs { display: flex; gap: 8px; background: #fff; padding: 0 32px; border-bottom: 1px solid #eee; }
.tab { padding: 12px 20px; border: none; background: transparent; cursor: pointer; font-size: 14px; color: #666; border-bottom: 2px solid transparent; }
.tab.active { color: #07c160; border-bottom-color: #07c160; font-weight: 600; }
.panel { display: none; }
.panel.active { display: block; }
.panel-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.panel-header h3 { font-size: 16px; font-weight: 600; }

/* 站点配置 */
.site-card { background: #fff; border-radius: 10px; padding: 24px; margin-bottom: 20px; box-shadow: 0 2px 10px rgba(0,0,0,0.04); }
.site-card h3 { font-size: 15px; margin-bottom: 16px; }
.site-card label { display: block; font-size: 13px; color: #555; margin-bottom: 14px; }
.site-card input[type=number], .site-card textarea {
  width: 100%; margin-top: 6px; padding: 10px 12px; border: 1px solid #e0e0e0; border-radius: 8px; font-size: 14px; outline: none; font-family: inherit;
}
.site-card input:focus, .site-card textarea:focus { border-color: #07c160; }
.row-inline { display: flex; align-items: center; gap: 10px; }
.row-inline input[type=checkbox] { width: 18px; height: 18px; accent-color: #07c160; }
.site-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.site-actions { margin-bottom: 40px; }

/* 底部菜单编辑器 */
.menu-group { border: 1px solid #eee; border-radius: 10px; padding: 16px; margin-bottom: 14px; background: #fafafa; }
.menu-group-header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.menu-group-header input { flex: 1; padding: 8px 12px; border: 1px solid #e0e0e0; border-radius: 6px; font-size: 14px; }
.menu-group-header button { padding: 6px 12px; border-radius: 6px; border: 1px solid #ddd; background: #fff; cursor: pointer; font-size: 13px; }
.menu-group-header button.del { color: #e54d42; border-color: #f3c2bd; }
.children-list { display: flex; flex-direction: column; gap: 10px; margin-left: 12px; padding-left: 12px; border-left: 2px solid #e0e0e0; }
.child-card { background: #fff; border: 1px solid #e0e0e0; border-radius: 8px; padding: 12px; }
.child-field { margin-bottom: 10px; }
.child-field label { display: block; font-size: 12px; color: #888; margin-bottom: 4px; }
.child-field input,
.child-field textarea { width: 100%; padding: 8px 10px; border: 1px solid #e0e0e0; border-radius: 6px; font-size: 14px; font-family: inherit; }
.child-field textarea { resize: vertical; }
.child-image-preview { max-height: 120px; max-width: 100%; object-fit: contain; margin-top: 6px; border-radius: 6px; border: 1px solid #eee; display: block; }
.child-actions { text-align: right; }
.child-actions button { padding: 6px 10px; border-radius: 6px; border: 1px solid #f3c2bd; background: #fff; color: #e54d42; cursor: pointer; font-size: 13px; }
.add-child { margin-top: 10px; padding: 6px 12px; border: 1px dashed #ccc; background: #fff; border-radius: 6px; cursor: pointer; font-size: 13px; color: #666; }
.hint { color: #888; font-size: 13px; margin: -4px 0 14px; }

/* Toast */
.toast { position: fixed; top: 24px; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,0.8); color: #fff; padding: 10px 20px; border-radius: 8px; font-size: 14px; z-index: 100; }


/* 线报管理 */
.platform-badge { display: inline-block; padding: 2px 10px; border-radius: 10px; font-size: 12px; color: #fff; }
.badge-jd { background: #e1251b; }
.badge-taobao { background: #ff6600; }
.badge-tmall { background: #c40000; }
.badge-pdd { background: #e02e24; }
.badge-other { background: #666; }
.status-on { color: #07c160; }
.status-off { color: #999; }
.link-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.link-row input, .link-row select { padding: 8px 10px; border: 1px solid #e0e0e0; border-radius: 6px; font-size: 13px; font-family: inherit; }
.link-row .dl-label { width: 110px; flex: none; }
.link-row select { width: 130px; flex: none; }
.link-row .dl-value { flex: 1; }
.link-row .dl-appid { width: 180px; flex: none; }
.link-row .del { flex: none; width: 32px; height: 32px; border: 1px solid #f3c2bd; background: #fff; color: #e54d42; border-radius: 6px; cursor: pointer; }
.modal-card select { width: 100%; margin-top: 6px; padding: 10px 12px; border: 1px solid #e0e0e0; border-radius: 8px; font-size: 14px; outline: none; font-family: inherit; background: #fff; }

/* 线报链接行（两行布局：主行 + 文案行） */
.link-row { display: block; border: 1px solid #eee; border-radius: 8px; padding: 10px; margin-bottom: 10px; background: #fafafa; }
.link-row-main { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.link-row .dl-desc { width: 100%; padding: 8px 10px; border: 1px dashed #ddd; border-radius: 6px; font-size: 13px; font-family: inherit; background: #fff; box-sizing: border-box; }

/* 草稿状态 */
.status-draft { color: #ff9900; }
.link-row .dl-desc { margin-bottom: 8px; }

/* 版本标记 */
.admin-version { position: fixed; right: 10px; bottom: 8px; font-size: 12px; color: #ccc; z-index: 200; pointer-events: none; }

/* 链接字段带可见字段名（防止误填） */
.dl-cap { font-size: 12px; color: #999; margin-bottom: 3px; }
.link-row-main { flex-wrap: wrap; }
.dl-field { display: flex; flex-direction: column; }
.dl-field-label { width: 110px; flex: none; }
.dl-field-type { width: 130px; flex: none; }
.dl-field-value { flex: 1; min-width: 200px; }
.dl-field-appid { width: 140px; flex: none; }
.dl-field input, .dl-field select { width: 100%; box-sizing: border-box; }
.dl-field-appid input.dl-appid { width: 100%; }

/* 线报列表工具栏（过滤Tab + 搜索） */
.deal-toolbar { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; flex-wrap: wrap; }
.deal-tabs { display: flex; gap: 8px; }
.deal-tab { padding: 7px 14px; border: 1px solid #e0e0e0; background: #fff; border-radius: 20px; cursor: pointer; font-size: 13px; color: #666; }
.deal-tab.active { border-color: #07c160; color: #07c160; background: #f0fbf4; font-weight: 600; }
.deal-cnt { color: #999; font-weight: 400; }
.deal-tab.active .deal-cnt { color: #07c160; }
#deal-search { flex: 1; min-width: 220px; padding: 8px 14px; border: 1px solid #e0e0e0; border-radius: 20px; font-size: 13px; outline: none; }
#deal-search:focus { border-color: #07c160; }

/* 批量操作栏 */
.deal-batchbar { display: flex; align-items: center; gap: 16px; margin-bottom: 10px; }
.batch-check { font-size: 13px; color: #666; gap: 6px !important; }
.batch-check input { width: 16px; height: 16px; accent-color: #07c160; }
#deal-batch-offline { font-size: 13px; }
#deal-batch-offline:disabled { opacity: 0.4; cursor: not-allowed; }
.deal-check { width: 16px; height: 16px; accent-color: #07c160; }

/* 标签列 */
.tags-cell { max-width: 180px; }
.tag-chip { display: inline-block; padding: 2px 8px; margin: 2px 4px 2px 0; background: #fff3e6; color: #ff6600; border-radius: 10px; font-size: 12px; cursor: pointer; }
.tag-chip:hover { background: #ffe4cc; }
.no-tag { color: #ccc; }
.time-cell { font-size: 12px; color: #888; white-space: nowrap; }

/* 表单定时设置 */
.time-range { display: flex; gap: 12px; }
.time-range label { flex: 1; }
.time-range input { width: 100%; margin-top: 6px; padding: 10px 12px; border: 1px solid #e0e0e0; border-radius: 8px; font-size: 14px; outline: none; font-family: inherit; box-sizing: border-box; }

/* 横幅编辑器 */
.banner-card { border: 1px solid #eee; border-radius: 10px; padding: 14px; margin-bottom: 14px; background: #fafafa; }
.banner-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.banner-idx { font-size: 13px; font-weight: 600; color: #555; }
.banner-head-ops button { padding: 4px 10px; margin-left: 6px; border: 1px solid #ddd; background: #fff; border-radius: 6px; cursor: pointer; font-size: 13px; }
.banner-head-ops button.del { color: #e54d42; border-color: #f3c2bd; }
.banner-head-ops button:disabled { opacity: 0.35; cursor: not-allowed; }
.banner-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 14px; }
.banner-grid .dl-field textarea { width: 100%; padding: 8px 10px; border: 1px solid #e0e0e0; border-radius: 6px; font-size: 13px; font-family: inherit; resize: vertical; box-sizing: border-box; }
.banner-grid .dl-field input[type=color] { width: 100%; height: 36px; padding: 2px; border: 1px solid #e0e0e0; border-radius: 6px; background: #fff; }
.banner-field-text { grid-column: span 2; }
.banner-img-preview { max-height: 60px; max-width: 100%; margin-top: 6px; border-radius: 6px; border: 1px solid #eee; display: block; object-fit: contain; }
.banner-qr-preview { width: 60px; height: 60px; }
@media (max-width: 900px) { .banner-grid { grid-template-columns: 1fr 1fr; } }

/* 落地页管理 */
.landing-admin-card { max-width: 980px; }
.landing-hint { margin: 6px 0 0; }
.landing-switch {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 20px;
  color: #057f40;
  background: #edf9f2;
  font-size: 14px;
  font-weight: 600;
}
.landing-switch input { width: 18px; height: 18px; accent-color: #07c160; }
.landing-text-editor { margin: 18px 0; }
.landing-editor-label { display: block; margin-bottom: 8px; color: #333; font-size: 14px; }
.landing-text-toolbar {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
  padding: 14px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #f8faf9;
}
.landing-text-toolbar label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 0;
  color: #555;
  font-size: 13px;
}
.landing-text-toolbar select,
.landing-text-toolbar input[type=number] {
  width: 100%;
  height: 38px;
  margin: 0;
}
.landing-text-toolbar input[type=color] {
  width: 48px;
  height: 38px;
  padding: 2px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}
.landing-number-field,
.landing-color-field,
.landing-check-field {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
}
.landing-number-field input[type=number] { max-width: 110px; }
.landing-color-field input[type=checkbox],
.landing-check-field input[type=checkbox] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: #07c160;
}
.landing-text-preview-title { margin: 12px 0 7px; color: #888; font-size: 12px; }
.landing-text-preview {
  min-height: 48px;
  padding: 12px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  border: 1px dashed #d6d9dd;
  border-radius: 8px;
  background: #fff;
  box-sizing: border-box;
}
.landing-image-field { margin: 18px 0; color: #555; font-size: 14px; }
.landing-image-field > span { display: block; margin-bottom: 8px; color: #333; }
.landing-image-field input[type=file] { font-size: 13px; }
.landing-image-preview-wrap {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid #e8e8e8;
  border-radius: 10px;
  background: #fafafa;
}
.landing-image-preview {
  display: block;
  width: 100%;
  max-width: 560px;
  max-height: 420px;
  margin-bottom: 10px;
  border-radius: 10px;
  object-fit: cover;
}
.landing-contact-preview {
  display: block;
  width: 260px;
  max-width: 100%;
  max-height: 360px;
  margin-bottom: 10px;
  border-radius: 10px;
  object-fit: contain;
}
@media (max-width: 900px) {
  .landing-text-toolbar { grid-template-columns: 1fr 1fr; }
}
.landing-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 760px) { .landing-grid { grid-template-columns: 1fr; } }

/* 置顶徽章 */
.pin-badge { display: inline-block; padding: 1px 6px; background: #fff3e6; color: #e1251b; border: 1px solid #f5c6c2; border-radius: 6px; font-size: 11px; margin-right: 4px; }

/* 同步到小程序：勾选组 */
.sync-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 14px 0 4px; padding: 10px 12px; background: #f6fbf7; border: 1px solid #dcefdf; border-radius: 8px; }

/* 独立后台只有小小耳火一个发布目标，内部保留勾选值但不重复展示。 */
#panel-deals .sync-row,
#deal-modal .sync-row { display: none; }

#panel-deals .task-table th:nth-child(4),
#panel-deals .task-table td:nth-child(4) { display: none; }
.sync-label { font-size: 13px; font-weight: 600; color: #333; }
.app-checks { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; }
.app-checks label { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: #444; cursor: pointer; }
.app-checks input[type=checkbox] { width: 16px; height: 16px; accent-color: #07c160; }
.app-checks .checks-all { padding: 2px 10px; border: 1px solid #07c160; color: #07c160; background: #fff; border-radius: 12px; font-size: 12px; cursor: pointer; }
.hint-inline { font-size: 12px; color: #999; }

/* 同步目标列 */
.sync-cell { max-width: 140px; }
.app-chip { display: inline-block; padding: 2px 8px; margin: 2px 4px 2px 0; background: #e8f5ec; color: #07c160; border-radius: 10px; font-size: 12px; }
.app-chip.app-chip-off { background: #f5f5f5; color: #bbb; }

/* 菜单按小程序分别填写文案 */
.task-sync-row { margin-top: 2px; margin-bottom: 14px; }
.app-copy-section { border: 1px solid #dcefdf; background: #f8fcf9; border-radius: 8px; padding: 12px; margin-bottom: 16px; }
.app-copy-title { font-size: 13px; font-weight: 600; color: #333; margin-bottom: 8px; }
.app-copy-section .hint { margin: 0 0 10px; }
.app-copy-field { padding: 10px; margin-bottom: 10px !important; background: #fff; border: 1px solid #e5eee7; border-radius: 8px; transition: opacity 0.2s; }
.app-copy-field:last-child { margin-bottom: 0 !important; }
.app-copy-field > span { display: block; color: #333; font-weight: 600; }
.app-copy-field textarea { box-sizing: border-box; resize: vertical; }
.app-copy-field.app-copy-disabled { opacity: 0.45; background: #f5f5f5; }

/* 小程序管理 */
.app-key-badge { display: inline-block; padding: 2px 10px; background: #eef4ff; color: #2b6cb0; border-radius: 6px; font-family: monospace; font-size: 13px; }

/* 备案信息需在网站底部长期展示，并链接至工信部备案官网。 */
.icp-footer {
  position: fixed;
  left: 50%;
  bottom: 8px;
  z-index: 200;
  transform: translateX(-50%);
  font-size: 12px;
  white-space: nowrap;
}
.icp-footer a { color: #999; text-decoration: none; }
.icp-footer a:hover { color: #666; text-decoration: underline; }
