/* AI写作：对齐 miniprogram-native/pages/write */

.page.write-page { background: #eee7dc; }
.write-page button { margin: 0; }

.write-page .switch-row { display: flex; gap: 8px; margin: 4px 0 9px; }
.write-page .switch-chip {
  flex: 1;
  min-width: 0;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  border: 1px dashed rgba(187, 164, 127, 0.72);
  background: #fffdf8;
  color: #29231e;
  font-size: 14px;
  font-weight: 800;
}
.write-page .switch-chip.is-active { border-style: solid; border-color: #c4a574; background: #f4ead8; color: #5c4630; cursor: default; }

.write-page .write-head { margin-bottom: 4px; }
.write-page .ai-mark { display: block; margin: 0 0 5px; color: #8c4630; font-size: 13px; font-weight: 800; line-height: 1.4; }
.write-page .headline { display: block; color: #29231e; font-family: "Songti SC", "STSong", "Noto Serif SC", "PingFang SC", serif; font-size: 28px; font-weight: 700; line-height: 1.2; }
.write-page .lead { display: block; margin-top: 5px; color: #8c8073; font-size: 13px; line-height: 1.5; }

.write-page .mode-tabs { display: flex; gap: 18px; margin: 9px 0 8px; border-bottom: 0.5px solid rgba(187, 164, 127, 0.35); }
.write-page .mode-tab { padding: 4px 0 7px; border: 0; background: transparent; color: #8c8073; font-size: 14px; font-weight: 700; }
.write-page .mode-tab.active { color: #29231e; box-shadow: inset 0 -2px 0 #29231e; }

.write-page .sheet { padding: 10px 10px 8px; border-radius: 14px; border: 0.5px solid #e3d5c4; background: #fbf8f2; }
.write-page .sheet-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.write-page .shortcut,
.write-page .meta-chip,
.write-page .chars {
  height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  border: 0.5px solid #e3d5c4;
  background: rgba(255, 253, 248, 0.92);
  color: #29231e;
  font-size: 12px;
  font-weight: 700;
  line-height: 31px;
}
.write-page .shortcut,
.write-page .meta-chip { display: flex; align-items: center; gap: 4px; padding: 0 9px 0 7px; line-height: 1; }
.write-page .chip-mark { display: block; flex-shrink: 0; width: 14px; height: 14px; object-fit: contain; }
.write-page .model-chip { max-width: 100%; overflow: hidden; display: inline-flex; align-items: center; gap: 4px; line-height: 1; padding: 0 10px; }
.write-page .chars { width: 70px; min-width: 70px; line-height: normal; outline: none; -moz-appearance: textfield; }
.write-page .chars::-webkit-outer-spin-button,
.write-page .chars::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.write-page .picked { display: flex; align-items: center; gap: 5px; margin-bottom: 6px; color: #5c4630; font-size: 11px; font-weight: 700; }
.write-page .topic-label { display: block; margin-bottom: 5px; color: #8c7058; font-size: 12px; font-weight: 800; }
.write-page .topic {
  display: block;
  width: 100%;
  min-height: 140px;
  padding: 4px 2px 6px;
  border: none;
  outline: none;
  resize: vertical;
  background: transparent;
  color: #29231e;
  font: inherit;
  font-size: 14px;
  line-height: 1.65;
}
.write-page .topic::placeholder,
.write-page .chars::placeholder { color: #b3a696; }

.write-page .picked-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin: 2px 0 9px; }
.write-page .picked-label { color: #8c7058; font-size: 10px; font-weight: 800; letter-spacing: 1px; }
.write-page .picked-list { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
.write-page .picked-chip {
  max-width: 100%;
  padding: 4px 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #f4ead8;
  border: 0.5px solid #e3d5c4;
  color: #5c4630;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.write-page .picked-chip.is-style { background: #29231e; border-color: #29231e; color: #f7efe2; }

.write-page .action-row { display: flex; align-items: center; gap: 14px; margin-top: 14px; }
.write-page .gen {
  min-width: 100px;
  height: 40px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: #29231e;
  color: #fffdf8;
  font-size: 14px;
  font-weight: 800;
  line-height: 40px;
  text-align: center;
}
.write-page .gen.is-busy { opacity: 0.55; pointer-events: none; }
.write-page .clear { padding: 0; border: 0; background: transparent; color: #8c8073; font-size: 13px; font-weight: 700; }
.write-page .foot-row { display: flex; gap: 18px; margin-top: 11px; }
.write-page .foot-link { display: flex; align-items: center; gap: 5px; padding: 0; border: 0; background: transparent; color: #29231e; font-size: 13px; font-weight: 700; line-height: 1; }
.write-page .foot-link .chip-mark { width: 16px; height: 16px; }
.write-page .error { display: block; margin-top: 8px; color: #c53e4a; font-size: 12px; }

/* 抽屉 */
body.wr-sheet-open { overflow: hidden; }
.write-page .wd-mask { position: fixed; inset: 0; z-index: 1100; background: rgba(41, 35, 30, 0.28); }
.write-page .wd-drawer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1101;
  display: flex;
  flex-direction: column;
  height: 78vh;
  padding: 12px 12px calc(12px + env(safe-area-inset-bottom));
  border-radius: 14px 14px 0 0;
  background: #fbf8f2;
  border-top: 0.5px dashed rgba(187, 164, 127, 0.72);
}
.write-page .wd-head { display: flex; flex-shrink: 0; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.write-page .wd-copy { min-width: 0; }
.write-page .wd-kicker { display: block; color: #8c7058; font-size: 9px; font-weight: 800; letter-spacing: 2px; }
.write-page .wd-title { display: block; margin-top: 3px; color: #29231e; font-size: 20px; font-weight: 800; }
.write-page .wd-sub { display: block; margin-top: 4px; color: #8c8073; font-size: 11px; line-height: 1.45; }
.write-page .wd-close {
  flex: 0 0 auto;
  height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  background: #fffdf8;
  border: 0.5px solid #e3d5c4;
  color: #29231e;
  font-size: 12px;
  font-weight: 700;
  line-height: 27px;
}
.write-page .wd-body { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.write-page .search {
  display: block;
  flex-shrink: 0;
  width: 100%;
  height: 36px;
  margin-bottom: 8px;
  padding: 0 10px;
  border: 0.5px solid #e3d5c4;
  border-radius: 9px;
  outline: none;
  background: #fffdf8;
  color: #29231e;
  font: inherit;
  font-size: 13px;
}
.write-page .paper-search { height: 34px; margin-bottom: 10px; background: #fff; box-shadow: inset 0 0 0 0.5px rgba(196, 165, 116, 0.18); }
.write-page .paper-tabs { display: flex; flex-shrink: 0; gap: 5px; margin: -4px 0 8px; }
.write-page .paper-tab {
  flex: 1;
  height: 28px;
  border: 0;
  line-height: 28px;
  text-align: center;
  border-radius: 999px;
  background: #fff;
  color: #8c7058;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: inset 0 0 0 0.5px #eadccb;
}
.write-page .paper-tab.is-on { background: #29231e; color: #f7efe2; box-shadow: none; }
.write-page .paper-tab.is-upload { flex: 0.7; }
.write-page .paper-sorts { display: flex; flex-shrink: 0; gap: 5px; margin: -2px 0 8px; }
.write-page .paper-sort {
  min-width: 44px;
  height: 24px;
  padding: 0 9px;
  border: 0;
  line-height: 24px;
  text-align: center;
  border-radius: 999px;
  background: #fff;
  color: #8c7058;
  font-size: 11px;
  font-weight: 800;
  box-shadow: inset 0 0 0 0.5px #eadccb;
}
.write-page .paper-sort.is-on { background: #29231e; color: #f7efe2; box-shadow: none; }
.write-page .paper-likes-sum { display: block; flex-shrink: 0; margin: -2px 0 7px 2px; color: #8c7058; font-size: 11px; font-weight: 700; }
.write-page .paper-note { display: block; margin-top: 4px; color: #a36b3b; font-size: 10px; }
.write-page .collision-note { font-size: 12px; }
.write-page .empty { display: block; color: #8c8073; font-size: 12px; }
.write-page .paper-group { margin-bottom: 14px; }
.write-page .paper-group-title { display: block; margin: 2px 2px 7px; color: #8c7058; font-size: 10px; font-weight: 800; letter-spacing: 1.5px; }
.write-page .paper-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 7px;
  padding: 9px 9px 9px 8px;
  border-radius: 11px;
  border: 1px solid #eadccb;
  background: #fffdf8;
  box-shadow: 0 4px 11px rgba(82, 58, 32, 0.04);
  cursor: pointer;
}
.write-page .paper-item.is-active { border-color: #29231e; background: #f4ead8; box-shadow: none; }
.write-page .paper-avatar {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  overflow: hidden;
  background: #fffdf8;
  box-shadow: inset 0 0 0 0.5px #eadccb;
  color: #5c4630;
  font-size: 12px;
  font-weight: 800;
}
.write-page .paper-avatar-img { display: block; width: 28px; height: 28px; object-fit: contain; }
.write-page .paper-avatar-img.is-fill { object-fit: cover; }
.write-page .paper-copy { flex: 1; min-width: 0; }
.write-page .paper-top { display: flex; align-items: flex-start; gap: 5px; min-width: 0; }
.write-page .paper-name {
  display: -webkit-box;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: #29231e;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.write-page .paper-used { flex: 0 0 auto; margin-top: 2px; padding: 1px 5px; border-radius: 999px; background: #29231e; color: #f7efe2; font-size: 9px; font-weight: 800; letter-spacing: 0.5px; }
.write-page .paper-type,
.write-page .paper-stats { display: block; margin-top: 3px; color: #a36b3b; font-size: 10px; font-weight: 700; }
.write-page .paper-desc {
  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;
}
.write-page .paper-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-height: 22px; margin-top: 6px; }
.write-page .paper-act { padding: 0; border: 0; background: transparent; color: #5c4630; font-size: 11px; font-weight: 800; line-height: 22px; }
.write-page .paper-act.is-on { color: #29231e; }
.write-page .paper-act.is-danger { color: #a36b3b; }
.write-page .paper-dates { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 5px; overflow: hidden; color: #8c8073; font-size: 10px; white-space: nowrap; }
.write-page .paper-dates span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.write-page .paper-foot { flex: 0 0 auto; padding-top: 6px; }
.write-page .paper-foot-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 40px;
  border: 0.5px solid rgba(140, 112, 88, 0.42);
  border-radius: 12px;
  background: #fffdf8;
  color: #5c4630;
  font-size: 14px;
  font-weight: 700;
}
.write-page .field-label { display: block; margin: 4px 0; color: #8c7058; font-size: 11px; font-weight: 800; }
.write-page .manage-area {
  display: block;
  width: 100%;
  min-height: 90px;
  margin-bottom: 8px;
  padding: 8px 9px;
  border-radius: 9px;
  border: 0.5px solid #e3d5c4;
  outline: none;
  resize: vertical;
  background: #fffdf8;
  color: #29231e;
  font: inherit;
  font-size: 13px;
  line-height: 1.55;
}
.write-page .manage-area.is-tall { min-height: 140px; }
.write-page .manage-actions { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 10px; }
.write-page .manage-btn { min-height: 32px; padding: 0 11px; border-radius: 999px; border: 0.5px solid #e3d5c4; background: #fffdf8; color: #5c4630; font-size: 12px; font-weight: 800; line-height: 31px; }
.write-page .manage-btn.is-primary { border-color: #29231e; background: #29231e; color: #f7efe2; }
.write-page .manage-btn.is-busy { opacity: 0.6; }
.write-page .row-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.write-page .row-act { padding: 0; border: 0; background: transparent; color: #5c4630; font-size: 11px; font-weight: 800; }
.write-page .row-act.is-danger { color: #8a4a3a; }

.write-page .help-group { margin-bottom: 12px; }
.write-page .help-group-title { display: block; margin-bottom: 6px; color: #8c7058; font-size: 11px; font-weight: 800; }
.write-page .help-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.write-page .help-tool {
  display: block;
  width: calc(50% - 3px);
  min-height: 74px;
  padding: 7px 6px 8px;
  border-radius: 9px;
  border: 0.5px solid #e3d5c4;
  background: #fffdf8;
  text-align: left;
}
.write-page .help-top { display: flex; align-items: center; gap: 5px; min-width: 0; }
.write-page .help-name { display: block; flex: 1; min-width: 0; overflow: hidden; color: #29231e; font-size: 12px; font-weight: 800; line-height: 1.25; white-space: nowrap; text-overflow: ellipsis; }
.write-page .help-desc { display: block; margin-top: 4px; color: #8c8073; font-size: 10px; line-height: 1.4; }

/* ys-type-mark compact */
.write-page .wr-tm { flex-shrink: 0; width: 20px; height: 20px; border-radius: 6px; }
.write-page .wr-tm .tm-mark { transform: scale(0.72); }
.tm.is-rule { background: #f1eadc; }
.tm.is-seal { background: #f6e8e2; }
.tm-rule .t1,
.tm-rule .t2,
.tm-rule .t3 { left: 3px; width: 12px; height: 1.5px; border-radius: 999px; background: #8c6a3a; }
.tm-rule .t1 { top: 4.5px; }
.tm-rule .t2 { top: 8.5px; width: 9px; opacity: 0.72; }
.tm-rule .t3 { top: 12.5px; width: 6px; opacity: 0.42; }
.tm-seal .t1 { top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 3px; border: 1.5px solid #c45c3a; }
.tm-seal .t2 { top: 5px; left: 5px; width: 8px; height: 8px; border-radius: 1.5px; background: #c45c3a; opacity: 0.22; }
.tm-seal .t3 { top: 7.5px; left: 6px; width: 6px; height: 3px; border-radius: 1px; background: #c45c3a; }

.write-page .meta-drawer { height: auto; max-height: 72vh; padding-top: 9px; border-top: 0.5px solid rgba(196, 165, 116, 0.34); box-shadow: 0 -9px 24px rgba(92, 70, 48, 0.08); }
.write-page .meta-handle { width: 32px; height: 4px; margin: 0 auto 9px; border-radius: 999px; background: #e3d5c4; }
.write-page .meta-drawer .wd-head { align-items: center; margin-bottom: 10px; }
.write-page .meta-drawer .wd-title { margin-top: 0; font-size: 17px; letter-spacing: 0.5px; }
.write-page .meta-drawer-body { padding-bottom: 4px; }
.write-page .meta-pick {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-bottom: 7px;
  padding: 12px 11px 12px 13px;
  border-radius: 11px;
  border: 0.5px solid rgba(196, 165, 116, 0.26);
  background: #fffdf8;
  box-shadow: 0 3px 8px rgba(92, 70, 48, 0.04);
  text-align: left;
}
.write-page .meta-pick.has-desc { min-height: 56px; }
.write-page .meta-pick-copy { flex: 1; min-width: 0; }
.write-page .meta-pick-title { display: block; color: #29231e; font-size: 15px; font-weight: 700; line-height: 1.3; }
.write-page .meta-pick-desc { display: block; margin-top: 4px; color: #8c8073; font-size: 11px; font-weight: 500; line-height: 1.45; }
.write-page .meta-pick-tick { flex: 0 0 auto; height: 20px; padding: 0 7px; border-radius: 999px; background: rgba(255, 253, 248, 0.72); color: #8a6a3e; font-size: 10px; font-weight: 700; line-height: 20px; }
.write-page .meta-pick.is-active { border-color: #c4a574; background: linear-gradient(180deg, #f8eedd 0%, #f3e4cb 100%); box-shadow: inset 3px 0 0 #c4a574, 0 5px 11px rgba(92, 70, 48, 0.08); }
.write-page .meta-pick.is-active .meta-pick-title { color: #5c4630; }
.write-page .meta-pick.is-active .meta-pick-desc { color: #7a6854; }

.write-page .switch-chip:active,
.write-page .mode-tab:active,
.write-page .shortcut:active,
.write-page .meta-chip:active,
.write-page .gen:active,
.write-page .clear:active,
.write-page .foot-link:active,
.write-page .paper-item:active,
.write-page .paper-foot-btn:active,
.write-page .help-tool:active,
.write-page .meta-pick:active,
.write-page .wd-close:active,
.write-page .manage-btn:active,
.write-page .row-act:active,
.write-page .picked-chip:active { opacity: 0.88; }

@media (min-width: 768px) {
  .page.write-page { padding-bottom: 32px; }
  .write-page .page-main { max-width: 860px; }
  .write-page .switch-row { gap: 10px; margin: 4px 0 16px; max-width: 320px; }
  .write-page .switch-chip { flex: 1 1 140px; height: 40px; border-radius: 12px; font-size: 15px; }
  .write-page .ai-mark { margin-bottom: 8px; font-size: 13px; }
  .write-page .headline { font-size: 24px; line-height: 1.3; }
  .write-page .lead { margin-top: 6px; font-size: 13px; }
  .write-page .mode-tabs { gap: 24px; margin: 12px 0 14px; }
  .write-page .mode-tab { padding: 6px 0 10px; font-size: 15px; }
  .write-page .sheet { padding: 16px 18px 14px; border-radius: 16px; }
  .write-page .sheet-meta { gap: 8px; margin-bottom: 12px; }
  .write-page .shortcut,
  .write-page .meta-chip,
  .write-page .chars { height: 36px; padding: 0 12px; border-radius: 18px; font-size: 13px; line-height: 34px; }
  .write-page .chip-mark { width: 16px; height: 16px; }
  .write-page .chars { width: 88px; min-width: 88px; }
  .write-page .topic-label,
  .write-page .picked { font-size: 12px; }
  .write-page .topic { min-height: 180px; font-size: 15px; line-height: 1.6; }
  .write-page .action-row { gap: 16px; margin-top: 18px; }
  .write-page .gen { min-width: 120px; height: 40px; padding: 0 20px; font-size: 14px; line-height: 40px; }
  .write-page .clear,
  .write-page .foot-link { font-size: 13px; }
  .write-page .foot-row { gap: 20px; margin-top: 14px; }
  .write-page .foot-link .chip-mark { width: 16px; height: 16px; }
  .write-page .shortcut:hover,
  .write-page .meta-chip:hover,
  .write-page .paper-item:hover,
  .write-page .help-tool:hover { border-color: #c4a574; }

  .write-page .wd-drawer {
    left: 196px;
    right: 24px;
    top: 64px;
    bottom: 24px;
    max-width: 560px;
    height: auto;
    margin: 0 auto;
    padding: 16px 18px 18px;
    border-radius: 16px;
  }
  .write-page .paper-drawer,
  .write-page .help-drawer { max-width: 720px; }
  .write-page .meta-drawer { max-width: 480px; max-height: none; }
  .write-page .wd-title { margin-top: 4px; font-size: 18px; line-height: 1.3; }
  .write-page .wd-kicker { font-size: 11px; letter-spacing: 2px; }
  .write-page .wd-sub,
  .write-page .empty { font-size: 12px; line-height: 1.45; }
  .write-page .wd-close { height: 32px; min-width: 32px; padding: 0 12px; font-size: 12px; line-height: 30px; }
  .write-page .search,
  .write-page .paper-search { height: 36px; margin-bottom: 10px; padding: 0 12px; font-size: 13px; line-height: 36px; }
  .write-page .paper-tabs { gap: 8px; margin-bottom: 10px; }
  .write-page .paper-tab { height: 32px; padding: 0 12px; font-size: 13px; line-height: 30px; }
  .write-page .paper-sort { height: 28px; padding: 0 10px; font-size: 12px; }
  .write-page .paper-group-title,
  .write-page .field-label { margin: 4px 0 8px; font-size: 12px; }
  .write-page .paper-item { gap: 10px; margin-bottom: 8px; padding: 10px 12px; border-radius: 12px; }
  .write-page .paper-avatar,
  .write-page .paper-avatar-img { width: 32px; height: 32px; flex-basis: 32px; font-size: 13px; }
  .write-page .paper-name { font-size: 14px; }
  .write-page .paper-used { font-size: 11px; }
  .write-page .paper-type,
  .write-page .paper-stats,
  .write-page .paper-desc,
  .write-page .paper-act,
  .write-page .paper-dates,
  .write-page .paper-note { font-size: 12px; }
  .write-page .paper-foot-btn,
  .write-page .manage-btn { min-height: 36px; padding: 0 14px; font-size: 13px; line-height: 34px; }
  .write-page .manage-area { min-height: 96px; margin-bottom: 10px; padding: 10px 12px; font-size: 13px; }
  .write-page .manage-area.is-tall { min-height: 140px; }
  .write-page .help-group-title { margin-bottom: 8px; font-size: 12px; }
  .write-page .help-grid { gap: 12px; }
  .write-page .help-tool { width: calc(33.33% - 8px); min-height: 72px; padding: 10px 12px; border-radius: 12px; }
  .write-page .help-name { font-size: 13px; }
  .write-page .help-desc { margin-top: 4px; font-size: 12px; }
  .write-page .meta-pick { margin-bottom: 8px; padding: 12px 14px; min-height: 0; }
  .write-page .meta-pick.has-desc { min-height: 0; }
  .write-page .meta-pick-title { font-size: 15px; }
  .write-page .meta-pick-desc { margin-top: 4px; font-size: 12px; }
  .write-page .meta-pick-tick { height: 24px; font-size: 11px; line-height: 24px; }
  .write-page .meta-handle { display: none; }
}
