/* 微信公众号图文编辑器 — 独立样式，不依赖 Tailwind */
:root {
  --we-p: #14532d;
  --we-a: #d6a12a;
  --we-bg: #f0f4f1;
  --we-bd: #d8eadf;
  --we-bar: #1a4d2e;
}
.we-page {
  min-height: 100vh;
  background: var(--we-bg);
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #333;
  overflow-x: hidden;
}
.we-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--we-bar);
  color: #fff;
  padding: 10px 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}
.we-topbar .we-brand {
  font-weight: 700;
  font-size: 15px;
  margin-right: 8px;
}
.we-toolbar-group {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}
.we-tb-btn {
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  min-height: 34px;
}
.we-tb-btn:hover {
  background: rgba(255, 255, 255, 0.22);
}
.we-tb-btn:active {
  transform: scale(0.98);
}
.we-tb-btn.we-primary {
  background: var(--we-a);
  border-color: #c9962a;
  color: #1a1a1a;
  font-weight: 600;
}
.we-tb-more-wrap {
  position: relative;
}
.we-tb-more {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 4px;
  background: #fff;
  color: #333;
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.15);
  padding: 8px;
  min-width: 160px;
  z-index: 60;
}
.we-tb-more-wrap.open .we-tb-more {
  display: block;
}
.we-tb-more button {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: none;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}
.we-tb-more button:hover {
  background: #f0faf4;
}
.we-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 300px;
  gap: 0;
  max-width: 1440px;
  margin: 0 auto;
  min-height: calc(100vh - 52px);
}
.we-left {
  background: #fff;
  border-right: 1px solid var(--we-bd);
  display: flex;
  flex-direction: column;
  min-height: 400px;
}
.we-left-tabs {
  display: flex;
  border-bottom: 1px solid var(--we-bd);
}
.we-left-tab {
  flex: 1;
  padding: 12px;
  border: none;
  background: #f8faf9;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: #555;
}
.we-left-tab.active {
  background: #fff;
  color: var(--we-p);
  box-shadow: inset 0 -2px 0 var(--we-p);
}
.we-comp-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px;
  border-bottom: 1px solid #eee;
}
.we-comp-cat {
  padding: 4px 8px;
  font-size: 12px;
  border-radius: 6px;
  border: 1px solid #ddd;
  background: #fafafa;
  cursor: pointer;
}
.we-comp-cat.active {
  border-color: var(--we-p);
  background: #e8f5ec;
  color: var(--we-p);
  font-weight: 600;
}
.we-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  max-height: calc(100vh - 160px);
}
.we-tpl-item,
.we-comp-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 10px;
  margin-bottom: 8px;
  border: 1px solid var(--we-bd);
  border-radius: 10px;
  background: #fafcfa;
  cursor: pointer;
  font-size: 13px;
}
.we-tpl-item:hover,
.we-comp-item:hover {
  border-color: var(--we-p);
}
.we-tpl-name {
  display: block;
  font-weight: 600;
  color: var(--we-p);
}
.we-tpl-cat {
  font-size: 11px;
  color: #888;
}
.we-center {
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
}
.we-canvas-wrap {
  width: 100%;
  max-width: 680px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--we-bd);
  box-shadow: 0 4px 20px rgba(26, 77, 46, 0.06);
  min-height: 420px;
}
.we-canvas {
  min-height: 380px;
  padding: 22px 20px 32px;
  outline: none;
  font-size: 16px;
  line-height: 1.8;
  color: #333;
}
.we-canvas:empty:before {
  content: "在这里输入或粘贴公众号文章内容，也可以从左侧选择农业模板快速生成。";
  color: #aaa;
  font-size: 15px;
}
.we-mod.we-mod-selected {
  outline: 2px solid var(--we-a);
  outline-offset: 2px;
}
.we-right {
  background: #fff;
  border-left: 1px solid var(--we-bd);
  display: flex;
  flex-direction: column;
}
.we-prop-head {
  padding: 12px 14px;
  font-weight: 700;
  color: var(--we-p);
  border-bottom: 1px solid var(--we-bd);
}
.we-prop-body {
  padding: 12px;
  overflow-y: auto;
  flex: 1;
  max-height: calc(100vh - 120px);
}
.we-prop-empty {
  color: #888;
  font-size: 13px;
  line-height: 1.6;
}
.we-prop-group {
  margin-bottom: 16px;
}
.we-prop-label {
  font-size: 12px;
  color: #666;
  margin-bottom: 6px;
  font-weight: 600;
}
.we-btn-sm {
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 6px;
  border: 1px solid #ccc;
  background: #fff;
  cursor: pointer;
  margin: 0 4px 6px 0;
}
.we-statbar {
  max-width: 680px;
  width: 100%;
  margin-top: 10px;
  font-size: 12px;
  color: #666;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
}
.we-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translate(-50%, 20px);
  background: var(--we-bar);
  color: #fff;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  z-index: 200;
  max-width: 92vw;
  text-align: center;
  transition: 0.25s;
}
.we-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.we-toast-err {
  background: #c53030;
}
.we-mobile-bar {
  display: none;
}
.we-sheet {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 150;
  align-items: flex-end;
  justify-content: center;
}
.we-sheet.open {
  display: flex;
}
.we-sheet-panel {
  background: #fff;
  width: 100%;
  max-height: 72vh;
  border-radius: 16px 16px 0 0;
  padding: 14px;
  overflow: auto;
}
.we-sheet-close {
  float: right;
  border: none;
  background: #eee;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
}
.we-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 160;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.we-modal.open {
  display: flex;
}
.we-modal-box {
  background: #fff;
  border-radius: 14px;
  padding: 20px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow: auto;
}
.we-modal-box h3 {
  margin: 0 0 14px;
  color: var(--we-p);
}
.we-field {
  margin-bottom: 12px;
}
.we-field label {
  display: block;
  font-size: 13px;
  color: #555;
  margin-bottom: 4px;
}
.we-field input,
.we-field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  box-sizing: border-box;
}
.we-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 16px;
}
.we-picker-row {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px;
  border: 1px solid #eee;
  border-radius: 8px;
  margin-bottom: 8px;
  background: #fafafa;
  cursor: pointer;
}
@media (max-width: 1024px) {
  .we-layout {
    grid-template-columns: 1fr;
  }
  .we-left,
  .we-right {
    display: none;
  }
  .we-mobile-bar {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid var(--we-bd);
    padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
    gap: 6px;
    justify-content: space-around;
    z-index: 40;
  }
  .we-mobile-bar button {
    flex: 1;
    min-height: 44px;
    border: 1px solid var(--we-bd);
    border-radius: 10px;
    background: #f8faf9;
    font-size: 12px;
    font-weight: 600;
    color: var(--we-p);
    cursor: pointer;
  }
  .we-center {
    padding-bottom: 72px;
  }
  .we-topbar {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }
}
