* { box-sizing: border-box; }
body { margin: 0; font-family: "Microsoft YaHei", "PingFang SC", sans-serif; background: #eef1f5; color: #1f2430; }
.app-container { min-height: 100vh; display: flex; flex-direction: column; }
.top-nav { height: 56px; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; background: #2383d8; color: #fff; }
.logo { font-size: 22px; font-weight: 700; }
.btn-back { border: 0; border-radius: 6px; background: #fff; color: #2383d8; padding: 6px 12px; cursor: pointer; font-size: 14px; }
.main-content { flex: 1; display: flex; overflow: hidden; }
.left-panel { width: 350px; background-color: #fff; border-right: 1px solid #e0e0e0; padding: 20px; overflow-y: auto; }
.right-panel { flex: 1; background-color: #fafafa; padding: 20px; display: flex; flex-direction: column; overflow: hidden; }
.right-panel h3 { font-size: 16px; font-weight: 700; margin-bottom: 20px; color: #333; }
h3 { margin: 0 0 12px; font-size: 24px; color: #1e2b3b; }
.setting-section { margin-bottom: 16px; }
h4 { margin: 0 0 8px; font-size: 14px; }
.input-file, .setting-input, .setting-textarea { width: 100%; border: 1px solid #d9d9d9; border-radius: 4px; background: #fff; padding: 8px 12px; font-size: 14px; }
.setting-textarea { min-height: 90px; resize: vertical; }
.tip { color: #6b7280; font-size: 12px; margin: 6px 0 0; }
.btn-primary, .btn-secondary { width: 100%; border: 0; border-radius: 4px; padding: 10px; cursor: pointer; font-size: 14px; margin-bottom: 8px; }
.btn-primary { background-color: #1e88e5; color: #fff; }
.btn-secondary { background-color: #e8edf4; color: #1f2430; }

.paper {
  flex: 1;
  max-width: 1242px;
  background: #f5f5f5;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  margin-bottom: 15px;
  min-height: 600px;
}

.paper-inner {
  width: min(100%, 640px);
  aspect-ratio: 794 / 1123;
  background: #e8c3c6;
  border-radius: 10px;
  overflow: hidden;
  padding: 12px;
  position: relative;
}

.paper-inner.template-bg {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  padding: 0;
}

.doc-content,
.paper-title,
.paper-footer {
  background: #fff;
}

.paper-title {
  margin: 0;
  border-radius: 14px 14px 0 0;
  padding: 14px 14px 8px;
  font-size: 28px;
  line-height: 1.08;
  font-weight: 900;
  letter-spacing: 0;
  white-space: nowrap;
}

.paper-title .black { color: #101010; }
.paper-title .blue { color: #1738e8; }
.paper-title .red { color: #e11414; }
.paper-title .dot { color: #101010; margin: 0 2px; }

.doc-content {
  margin: 0;
  padding: 8px 14px 8px;
  color: #1a1a1a;
  border-radius: 0;
  font-size: 14px;
  line-height: 1.72;
  font-weight: 500;
}

.paper-inner.template-bg .doc-content {
  position: absolute;
  left: 7%;
  top: 18%;
  width: 86%;
  height: 74%;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 0;
  font-size: 14px;
  line-height: 1.58;
  color: #151515;
}

.paper-inner.template-bg .doc-content .doc-list {
  padding-left: 22px;
}

.paper-inner.template-bg .paper-title,
.paper-inner.template-bg .paper-footer {
  display: none;
}

.doc-content .doc-list {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: poem-item;
}

.doc-content .doc-item {
  counter-increment: poem-item;
  margin: 0 0 4px;
}

.doc-content .doc-item::before {
  content: counter(poem-item) "、";
  margin-right: 4px;
}

.doc-content .em {
  color: #c81e1e;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 2px;
}

.doc-content .note {
  display: inline-block;
  background: #fff200;
  color: #111;
  font-weight: 800;
  padding: 1px 6px 2px;
  margin: 4px 0 6px;
}

.placeholder { color: #8a9099; margin: 0; }

.paper-footer {
  border-radius: 0 0 14px 14px;
  text-align: center;
  font-size: 16px;
  font-weight: 500;
  color: #111;
  padding: 0 0 8px;
}

.preview-sample-image {
  width: auto;
  height: auto;
  max-width: 640px;
  max-height: 860px;
  border-radius: 6px;
  object-fit: contain;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
}

@media (max-width: 980px) {
  .main-content { flex-direction: column; }
  .left-panel { width: 100%; border-right: 0; border-bottom: 1px solid #e0e0e0; }
}

@media (max-width: 768px) {
  .paper { padding: 10px; min-height: 420px; }
  .paper-inner { width: min(100%, 420px); padding: 10px; }
  .paper-title { font-size: 24px; padding: 12px 10px 6px; }
  .paper-title .dot { margin: 0 1px; }
  .doc-content { font-size: 13px; padding: 6px 10px; }
  .paper-footer { font-size: 14px; padding-bottom: 6px; }
  .preview-sample-image { max-width: 260px; max-height: 460px; }
}

.preview-note { margin: 6px 0 0; font-size: 12px; color: #6b7280; }


.doc-plan { padding: 2px 2px 6px; }
.doc-plan-title {
  margin: 0 0 8px;
  font-weight: 700;
  color: #1738e8;
  line-height: 1.45;
}
.doc-plan-p {
  margin: 0 0 8px;
  color: #111;
  line-height: 1.6;
}

.html-preview-pane {
  width: min(100%, 980px);
  height: min(100%, 920px);
  background: linear-gradient(180deg, #1f2937 0%, #111827 100%);
  border-radius: 18px;
  padding: 14px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, .14);
}

.html-preview-frame {
  width: 100%;
  height: 100%;
  min-height: 720px;
  border: 0;
  border-radius: 12px;
  background: #fff;
}

.code-editor {
  min-height: 220px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.6;
  background: #0f172a;
  color: #e2e8f0;
  border-color: #1e293b;
}
