/* 成稿查看：对齐 miniprogram-native/pages/result */

.page.result-page {
  padding: calc(6px + env(safe-area-inset-top)) 0 calc(24px + env(safe-area-inset-bottom));
  background: #eee7dc;
}

.result-page .ai-mark { display: block; margin: 0 0 8px; color: #8c4630; font-size: 13px; font-weight: 800; line-height: 1.4; }

.back-pill {
  display: inline-flex;
  align-items: center;
  height: 28px;
  margin: 4px 0 10px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid #e3d5c4;
  background: #fffdf8;
  color: #29231e;
  font-size: 13px;
  font-weight: 700;
}

.source-block { margin: 0 0 2px; padding: 0 0 10px; border-bottom: 1px dashed #d4c4b0; }
.source-row {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-height: 22px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}
.source-label { flex-shrink: 0; color: #29231e; font-size: 13px; font-weight: 800; }
.source-preview { flex: 1; min-width: 0; overflow: hidden; color: #8c8073; font-size: 13px; font-weight: 500; white-space: nowrap; text-overflow: ellipsis; }
.source-toggle { flex-shrink: 0; color: #8c8073; font-size: 13px; font-weight: 600; }
.source-body { display: block; margin: 6px 0 0; color: #29231e; font-size: 14px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }

.result-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; min-height: 28px; margin: 8px 0 6px; }
.result-label { color: #29231e; font-size: 13px; font-weight: 800; }
.copy-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 24px;
  margin: 0;
  padding: 0 2px;
  border: 0;
  background: transparent;
  color: #29231e;
  font-size: 13px;
  font-weight: 600;
}
.copy-ico { position: relative; width: 9px; height: 11px; margin: 4px 2px 0 4px; border: 1px solid #29231e; border-radius: 2px; }
.copy-ico::before {
  content: "";
  position: absolute;
  left: -4px;
  top: -4px;
  width: 9px;
  height: 11px;
  border: 1px solid #29231e;
  border-radius: 2px;
  background: #eee7dc;
}
.copy-ico.is-doc { width: 8px; height: 10px; }

.article { padding: 12px 12px 4px; border-radius: 14px; border: 1px solid rgba(163, 138, 108, 0.28); background: #efe6d6; }
.paper-title { display: block; margin: 0 0 10px; color: #29231e; font-size: 17px; font-weight: 800; line-height: 1.45; }
.para { display: block; margin: 0 0 12px; color: #29231e; font-size: 15px; font-weight: 400; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
.para:last-child { margin-bottom: 0; }
.graphic-img { display: block; width: 100%; height: auto; margin: 0 0 12px; border-radius: 9px; background: #e8dfd0; }
.graphic-img.is-cover { aspect-ratio: 16 / 9; object-fit: cover; }
.graphic-img.is-portrait { aspect-ratio: 3 / 4; object-fit: cover; }
.result-page .empty { display: block; color: #8c8073; font-size: 13px; line-height: 1.6; }

.match-wait {
  margin-top: 24px;
  padding: 24px 14px;
  border-radius: 14px;
  border: 1px dashed rgba(187, 164, 127, 0.72);
  background: #fffdf8;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.match-spinner { width: 28px; height: 28px; margin-bottom: 12px; border: 2.5px solid rgba(187, 164, 127, 0.25); border-top-color: #bb8c5f; border-radius: 50%; animation: match-spin 0.9s linear infinite; }
@keyframes match-spin { to { transform: rotate(360deg); } }
.match-kicker { display: block; color: #8c7058; font-size: 9px; font-weight: 800; letter-spacing: 2px; }
.match-title { display: block; margin-top: 5px; color: #29231e; font-size: 18px; font-weight: 800; }
.match-sub { display: block; margin-top: 6px; color: #8c8073; font-size: 12px; line-height: 1.55; }

.cover-prompt,
.review-card { margin: 0 0 10px; padding: 10px 12px; border-radius: 12px; border: 1px dashed rgba(187, 164, 127, 0.72); background: #fffdf8; }
.cover-kicker { display: block; color: #8c7058; font-size: 10px; font-weight: 800; letter-spacing: 1px; }
.cover-body { display: block; margin-top: 4px; color: #29231e; font-size: 13px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }

.result-page .action-col { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.result-page .action-row { display: flex; gap: 8px; }
.result-page .chip {
  flex: 1;
  min-width: 0;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin: 0;
  padding: 2px 6px 2px 3px;
  border-radius: 999px;
  border: 1px solid #e3d5c4;
  background: #f4efe4;
  color: #5c5046;
  font-size: 12px;
  font-weight: 800;
}
.result-page .chip.is-primary { border-color: #29231e; background: #29231e; color: #fffdf8; }
.result-page .chip.is-busy { opacity: 0.45; }
.result-page .chip > span:last-child { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* ys-type-mark compact + plain：单色小标 */
.rs-mark { display: flex; flex-shrink: 0; align-items: center; justify-content: center; width: 20px; height: 20px; filter: brightness(0); opacity: 0.68; }
.rs-mark .tm-mark { transform: scale(0.72); }
.result-page .chip.is-primary .rs-mark { filter: brightness(0) invert(1); opacity: 0.92; }

/* 继续优化 / 改稿抽屉 */
body.rs-sheet-open { overflow: hidden; }
.rs-mask { position: fixed; inset: 0; z-index: 1200; background: rgba(41, 35, 30, 0.32); }
.rs-drawer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1201;
  display: flex;
  flex-direction: column;
  max-height: 78vh;
  padding: 6px 14px calc(14px + env(safe-area-inset-bottom));
  border-radius: 18px 18px 0 0;
  background: #fbf8f2;
  border-top: 0.5px dashed rgba(187, 164, 127, 0.72);
}
.rs-drawer.is-enter { animation: rsSheetUp 0.22s ease; }
@keyframes rsSheetUp { from { transform: translateY(12px); opacity: 0.55; } to { transform: translateY(0); opacity: 1; } }
.rs-handle { width: 36px; height: 4px; margin: 2px auto 9px; border-radius: 999px; background: #d8c6b1; }
.rs-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 9px; }
.rs-copy { flex: 1; min-width: 0; }
.rs-kicker { display: block; color: #8c7058; font-size: 9px; font-weight: 800; letter-spacing: 2px; }
.rs-title { display: block; margin-top: 3px; color: #29231e; font-size: 20px; font-weight: 800; }
.rs-sub { display: block; margin-top: 4px; color: #8c8073; font-size: 11px; line-height: 1.5; }
.rs-close {
  flex: 0 0 auto;
  min-width: 44px;
  height: 28px;
  margin: 0;
  padding: 0 9px;
  border-radius: 999px;
  border: 0.5px solid #e3d5c4;
  background: #fffdf8;
  color: #29231e;
  font-size: 12px;
  font-weight: 700;
  line-height: 27px;
}
.rs-body { flex: 1; min-height: 0; max-height: 56vh; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.rs-pick {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  margin: 0 0 7px;
  padding: 10px 9px 10px 8px;
  border-radius: 11px;
  border: 0.5px solid #eadccb;
  background: #fffdf8;
  box-shadow: 0 4px 11px rgba(82, 58, 32, 0.04);
  text-align: left;
}
.rs-pick:active { border-color: #c4a574; background: linear-gradient(180deg, #f7efe2 0%, #f4ead8 100%); }
.rs-pick.is-busy { opacity: 0.45; }
.rs-pick-copy { flex: 1; min-width: 0; }
.rs-pick-top { display: flex; align-items: center; gap: 5px; min-width: 0; }
.rs-pick-title { flex: 1; min-width: 0; overflow: hidden; color: #29231e; font-size: 14px; font-weight: 800; line-height: 1.3; white-space: nowrap; text-overflow: ellipsis; }
.rs-pick-chip { flex: 0 0 auto; padding: 1px 5px; border-radius: 999px; background: #29231e; color: #f7efe2; font-size: 9px; font-weight: 800; }
.rs-pick-sub { display: -webkit-box; margin-top: 4px; overflow: hidden; color: #8c8073; font-size: 11px; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.rs-pick-action { flex: 0 0 auto; margin-top: 3px; color: #8c7058; font-size: 11px; font-weight: 800; }
.wx-tune { display: block; margin: 0 0 8px; padding: 8px 10px; border-radius: 10px; border: 0.5px solid #eadccb; background: #fffdf8; }
.wx-tune-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.wx-tune-row + .wx-tune-row { margin-top: 6px; }
.wx-tune-label { flex: 0 0 34px; color: #8c7058; font-size: 11px; font-weight: 800; }
.wx-dot { width: 26px; height: 26px; padding: 3px; margin: 0; border-radius: 50%; border: 1.5px solid transparent; background: transparent; }
.wx-dot > span { display: block; width: 100%; height: 100%; border-radius: 50%; }
.wx-dot.is-on { border-color: #29231e; }
.wx-seg { height: 26px; margin: 0; padding: 0 11px; border-radius: 999px; border: 0.5px solid #e3d5c4; background: #fffdf8; color: #29231e; font-size: 11px; font-weight: 700; }
.wx-seg.is-on { border-color: #29231e; background: #29231e; color: #fffdf8; }
.wx-cover { display: block; margin: 0 0 8px; padding: 9px 10px 8px; border-radius: 10px; border: 0.5px dashed rgba(187, 164, 127, 0.72); background: #fffdf8; }
.wx-cover-label { display: block; margin-bottom: 6px; color: #8c7058; font-size: 11px; font-weight: 800; }
.wx-cover-row { display: flex; align-items: flex-end; gap: 8px; }
.wx-cover-frame { position: relative; display: block; height: 0; overflow: hidden; border-radius: 6px; background: #eee3d2; }
.wx-cover-frame img { position: absolute; max-width: none; height: auto; }
.wx-cover-frame.is-wide { flex: 1 1 auto; padding-top: calc((100% - 78px) / 2.35); }
.wx-cover-frame.is-square { flex: 0 0 auto; width: 70px; padding-top: 70px; }
.wx-cover-cap { display: block; margin-top: 5px; color: #8c8073; font-size: 10px; }
.wx-cover-tip { display: block; margin-top: 3px; color: #c53e4a; font-size: 11px; line-height: 1.5; }
.wx-preview-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 8px; color: #8c7058; font-size: 12px; font-weight: 700; }
.wx-preview-off { flex: 0 0 auto; height: 26px; padding: 0 11px; border-radius: 999px; border: 0.5px solid #e3d5c4; background: #fffdf8; color: #29231e; font-size: 11px; font-weight: 700; }
.wx-preview { padding: 16px 14px; border-radius: 10px; background: #fff; overflow: hidden; word-break: break-word; }
.wx-preview-title { margin: 0 0 14px; color: #111; font-size: 22px; font-weight: 700; line-height: 1.4; }
.wx-preview img { max-width: 100%; }
.rs-toggle { display: flex; align-items: center; gap: 10px; width: 100%; margin: 0 0 8px; padding: 10px 12px; border-radius: 11px; border: 0.5px solid #eadccb; background: #fffdf8; text-align: left; }
.rs-toggle-copy { flex: 1; min-width: 0; }
.rs-toggle-title { display: block; color: #29231e; font-size: 14px; font-weight: 800; }
.rs-toggle-sub { display: block; margin-top: 3px; color: #8c8073; font-size: 11px; line-height: 1.45; }
.rs-switch { position: relative; flex: 0 0 auto; width: 40px; height: 24px; border-radius: 999px; background: #d8cdbd; }
.rs-switch-dot { position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.25); }
.rs-toggle.is-on .rs-switch { background: #29231e; }
.rs-toggle.is-on .rs-switch-dot { left: 18px; }
.rs-note { display: block; margin: 0 0 8px; padding: 9px 11px; border-radius: 11px; border: 0.5px dashed rgba(187, 164, 127, 0.72); background: #fff9ec; }
.rs-note-title { display: block; margin-bottom: 4px; color: #8c7058; font-size: 11px; font-weight: 800; letter-spacing: 1px; }
.rs-note-line { display: block; position: relative; padding-left: 12px; color: #4a4036; font-size: 12px; line-height: 1.55; }
.rs-note-line + .rs-note-line { margin-top: 3px; }
.rs-note-line::before { content: ""; position: absolute; left: 2px; top: 0.62em; width: 4px; height: 4px; border-radius: 50%; background: #c4a574; }
.rs-tpl { display: block; width: 100%; margin: 0 0 8px; padding: 10px 10px 8px; border-radius: 11px; border: 0.5px solid #eadccb; background: #fffdf8; box-shadow: 0 4px 11px rgba(82, 58, 32, 0.04); text-align: left; }
.rs-tpl.is-rec { border-color: #c4a574; }
.rs-tpl:active { border-color: #c4a574; background: #f7efe2; }
.rs-tpl-top { display: flex; align-items: center; gap: 6px; min-width: 0; }
.rs-tpl-dot { flex: 0 0 auto; width: 10px; height: 10px; border-radius: 50%; }
.rs-tpl-name { flex: 1; min-width: 0; overflow: hidden; color: #29231e; font-size: 14px; font-weight: 800; white-space: nowrap; text-overflow: ellipsis; }
.rs-tpl-desc { display: block; margin-top: 3px; color: #8c8073; font-size: 11px; line-height: 1.45; }
.rs-tpl-sample { display: block; margin-top: 7px; padding: 6px 10px 4px; overflow: hidden; zoom: 0.78; border-radius: 8px; border: 0.5px solid #efe6d8; background: #fff; pointer-events: none; }
.rs-tpl-sample > :first-child { margin-top: 0 !important; }
.rs-tpl-sample section > :first-child { margin-top: 0 !important; }
.rs-tpl-sample p:last-child { margin-bottom: 0.3em !important; }
.result-page .error { display: block; margin-top: 8px; color: #c53e4a; font-size: 12px; }
.result-page .graphic-gap { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; padding: 10px 12px; border-radius: 12px; border: 1px dashed rgba(187, 164, 127, 0.72); background: #fffdf8; }
.result-page .graphic-gap.is-partial { border-color: rgba(197, 62, 74, 0.45); }
.result-page .graphic-gap-text { flex: 1; min-width: 0; margin: 0; color: #29231e; font-size: 12px; line-height: 1.55; word-break: break-word; }
.result-page .graphic-gap .retry-btn { flex: 0 0 auto; margin-top: 0; min-height: 36px; }
.result-page .graphic-gap .retry-btn.is-busy { opacity: 0.6; }
.result-page .retry-btn {
  margin-top: 8px;
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid #29231e;
  background: #29231e;
  color: #fffdf8;
  font-size: 12px;
  font-weight: 800;
}

@media (prefers-reduced-motion: reduce) {
  .match-spinner,
  .rs-drawer.is-enter { animation: none; }
}

@media (min-width: 768px) {
  .page.result-page { padding-left: 0; padding-right: 0; }
  .result-page .page-main { max-width: 760px; margin: 0 auto; padding: 12px 24px 0; }
  .back-pill { height: 36px; padding: 0 16px; margin: 4px 0 12px; font-size: 14px; }
  .result-page .ai-mark { margin-bottom: 12px; font-size: 13px; }
  .source-label,
  .source-preview,
  .source-toggle { font-size: 14px; }
  .result-bar { gap: 10px 16px; min-height: 32px; margin: 12px 0 10px; }
  .result-label,
  .copy-chip { font-size: 14px; }
  .copy-chip:hover { text-decoration: underline; }
  .paper-title { font-size: 18px; }
  .para,
  .source-body { font-size: 15px; line-height: 1.7; }
  .graphic-img { margin-bottom: 16px; border-radius: 12px; }
  .result-page .action-row { flex-wrap: wrap; align-items: center; gap: 10px; }
  .result-page .chip { flex: 0 0 auto; max-width: 240px; height: 40px; padding: 0 16px 0 8px; gap: 6px; border-radius: 20px; font-size: 14px; font-weight: 700; }
  .rs-drawer {
    left: 24px;
    right: 24px;
    top: 56px;
    bottom: 24px;
    max-width: 640px;
    max-height: none;
    margin: 0 auto;
    padding: 16px 18px 18px;
    border-radius: 16px;
  }
  .rs-drawer.is-enter { animation: none; }
  .rs-handle { display: none; }
  .rs-title { font-size: 18px; }
  .rs-kicker { font-size: 11px; }
  .rs-sub,
  .rs-pick-sub { font-size: 12px; }
  .rs-close { height: 32px; min-width: 32px; padding: 0 12px; font-size: 12px; line-height: 30px; }
  .rs-body { max-height: none; }
}

/* 头条排版预览：照 mp.toutiao.com 文章编辑器 10-07 实测（正文 17px/1.75/#222、段距 20px；小标题 18px 粗体，前面红色斜杠；引用左侧 2px 灰线、文字 #999/16px；列表序号不缩进） */
.tt-tips { display: block; margin: 0 0 8px; padding: 9px 12px; border-radius: 10px; border: 0.5px dashed rgba(187, 164, 127, 0.72); background: #fffdf8; }
.tt-tips-title { display: block; margin-bottom: 4px; color: #8c7058; font-size: 11px; font-weight: 800; }
.tt-tips ul { margin: 0; padding-left: 16px; }
.tt-tips li { color: #5f5145; font-size: 12px; line-height: 1.6; }
.tt-preview { padding: 16px 14px; border-radius: 10px; background: #fff; color: #222; font-family: "PingFang SC", Arial, "Hiragino Sans GB", "Microsoft YaHei", sans-serif; overflow: hidden; word-break: break-word; }
.tt-preview .tt-title { margin: 0 0 16px; color: #222; font-size: 22px; font-weight: 700; line-height: 1.4; text-align: left; }
.tt-preview p { margin: 0 0 20px; color: #222; font-size: 17px; line-height: 1.75; text-align: justify; }
.tt-preview h1 { margin: 20px 0 12px; color: #222; font-size: 18px; font-weight: 700; line-height: 30px; }
.tt-preview h1::before { content: ""; display: inline-block; width: 10px; height: 26px; margin-right: 6px; vertical-align: middle; background: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='26' viewBox='0 0 10 26'%3E%3Cpath d='M9.5 6.57L4.5 19.43H0L5 6.57z' fill='%23FF403A'/%3E%3C/svg%3E") 0 -2px / cover no-repeat; }
.tt-preview blockquote { position: relative; margin: 0 0 20px; padding-left: 16px; }
.tt-preview blockquote::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: #e6e6e6; }
.tt-preview blockquote p { margin: 0; color: #999; font-size: 16px; line-height: 28px; }
.tt-preview ul, .tt-preview ol { margin: 0 0 20px; padding-left: 0; list-style-position: inside; }
.tt-preview li { color: #222; font-size: 17px; line-height: 1.75; text-align: justify; }
.tt-preview hr { height: 1px; margin: 20px 0; border: 0; background: #e8e8e8; }
.tt-preview img { display: block; max-width: 100%; height: auto; margin: 0 auto; border-radius: 4px; }
.tt-preview strong { font-weight: 700; }
/* 版式抽屉里的小样：紧凑一些，避免四张卡片太长 */
.rs-tpl-sample .tt-sample { padding: 0; border-radius: 0; max-height: 300px; }
.tt-sample p { margin: 0 0 8px; font-size: 15px; line-height: 1.6; }
.tt-sample h1 { margin: 10px 0 6px; font-size: 16px; line-height: 26px; }
.tt-sample blockquote { margin: 0 0 8px; }
.tt-sample blockquote p { margin: 0; font-size: 14px; line-height: 24px; }
.tt-sample ul, .tt-sample ol { margin: 0 0 8px; }
.tt-sample li { font-size: 15px; line-height: 1.6; }
.tt-sample hr { margin: 8px 0; }
