/* ============================================================================
 * 「Word助手」（老板板块）· 样式
 * ----------------------------------------------------------------------------
 * 前缀统一 `wd-`（站内 ac- / bm- / pp- / ct- 都已被占，另起一个不会互相影响）。
 *
 * 🔴 三条硬规矩（都是站内踩过的坑，别再犯）：
 *  ① 独立 CSS 文件，**排在 style.css 之后**加载 —— 绝不改别人的 style.css。
 *  ② 含 absolute 装饰物的容器**必须给 position: relative** ——
 *     否则会撑宽 document，手机端整页缩成 77%（桌面看不出来）。
 *  ③ `hidden` 会被 display:flex/grid 盖掉 → 凡是 flex 容器都要补 `[hidden]{display:none!important}`。
 *
 * 预览区（.wd-paper）的字号/行距/缩进**全部由后端 layout() 给的 px 驱动**，
 * 这里只定字体与颜色 —— 网页上看到的就是下载后的 Word，不许出现第二套排版数字。
 * ========================================================================== */

/* ---------------- 容器 ---------------- */
.wd-wrap { max-width: 720px; margin: 0 auto; padding: 0 14px 30px; }
.wd-wrap [hidden] { display: none !important; }

/* ---------------- 头部 ---------------- */
.wd-hero {
  position: relative; overflow: hidden;
  margin: 4px 0 14px; padding: 18px 18px 16px; border-radius: 20px;
  background: linear-gradient(135deg, #fff4ec 0%, #ffe7d6 100%);
  border: 1px solid rgba(249, 89, 1, 0.14);
}
.wd-hero h2 { font-size: 19px; font-weight: 800; color: #3a2a1e; letter-spacing: 0.3px; }
.wd-hero p { margin-top: 6px; font-size: 13px; line-height: 1.65; color: #7a6555; }
.wd-hero-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 11px; }
.wd-hero-tags span {
  font-size: 11.5px; padding: 4px 9px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.78); color: #b6602a; font-weight: 600;
}
.wd-hero-glow {
  position: absolute; right: -46px; top: -56px; width: 170px; height: 170px;
  background: radial-gradient(circle, rgba(249, 89, 1, 0.18) 0%, rgba(249, 89, 1, 0) 70%);
  border-radius: 50%; pointer-events: none;
}

/* ---------------- 我的作品（第一屏可见） ---------------- */
.wd-hist { margin-bottom: 12px; padding: 12px 12px 10px; background: var(--card); border-radius: 18px; box-shadow: 0 2px 10px rgba(58, 42, 30, 0.05); }
.wd-hist-hd { display: flex; align-items: baseline; gap: 8px; margin: 0 2px 9px; }
.wd-hist-hd b { font-size: 14.5px; font-weight: 700; }
.wd-hist-hd em { font-style: normal; font-size: 11.5px; color: var(--text2); }
.wd-hist-row { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 3px; scrollbar-width: none; }
.wd-hist-row::-webkit-scrollbar { display: none; }
.wd-hist-item { flex: 0 0 104px; width: 104px; cursor: pointer; }
.wd-hist-item:active { opacity: 0.68; }
.wd-hist-thumb {
  position: relative; width: 104px; height: 132px; border-radius: 12px; overflow: hidden;
  background: #fff; border: 1px solid #efe3d8; box-shadow: 0 2px 8px rgba(58, 42, 30, 0.07);
  padding: 9px 8px; display: flex; flex-direction: column; gap: 4px;
}
.wd-hist-thumb i { display: block; height: 5px; border-radius: 2px; background: #eadfd5; }
.wd-hist-thumb i:first-child { height: 7px; width: 72%; background: #d9c8ba; margin: 0 auto 3px; }
.wd-hist-thumb i:nth-child(4) { width: 82%; }
.wd-hist-thumb i:nth-child(6) { width: 64%; }
.wd-hist-score {
  position: absolute; right: 5px; bottom: 5px; font-size: 10px; font-weight: 700;
  padding: 1px 5px; border-radius: 6px; background: #f2f7f2; color: #3f8a55;
}
.wd-hist-score.fair { background: #fdf5e7; color: #b07d20; }
.wd-hist-score.poor { background: #fdeeee; color: #c0392b; }
.wd-hist-item > b {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  margin-top: 6px; font-size: 12px; font-weight: 700; line-height: 1.35;
}
.wd-hist-item > span { display: block; margin-top: 2px; font-size: 10.5px; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wd-hist--empty {
  display: flex; flex-direction: column; gap: 5px; padding: 13px 14px;
  border: 1px dashed #eddccd; border-radius: 14px; background: #fffdfb;
}
.wd-hist--empty b { font-size: 14px; font-weight: 700; }
.wd-hist--empty span { font-size: 12px; line-height: 1.65; color: var(--text2); }

/* ---------------- Tab ---------------- */
.wd-tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.wd-tab {
  flex: 1 1 0; min-width: 0; padding: 11px 8px; border: 0; cursor: pointer;
  border-radius: 14px; background: var(--chip-bg); color: #8b7360;
  font-size: 14px; font-weight: 700; font-family: inherit;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.wd-tab.on { background: var(--grad); color: #fff; box-shadow: 0 5px 14px rgba(249, 89, 1, 0.26); }

/* ---------------- 卡片与表单 ---------------- */
.wd-card {
  position: relative; margin-bottom: 12px; padding: 15px 15px 16px;
  background: var(--card); border-radius: 18px; box-shadow: 0 2px 10px rgba(58, 42, 30, 0.05);
}
.wd-label { display: flex; align-items: baseline; gap: 7px; margin-bottom: 9px; }
.wd-label b { font-size: 14.5px; font-weight: 700; }
.wd-label em { font-style: normal; font-size: 11.5px; color: var(--text2); }
.wd-ta {
  display: block; width: 100%; min-height: 96px; padding: 12px 13px;
  border: 1px solid #f0e2d6; border-radius: 14px; background: #fffdfb;
  font-family: inherit; font-size: 14px; line-height: 1.7; color: var(--text);
  resize: vertical;
}
.wd-ta:focus { outline: none; border-color: rgba(249, 89, 1, 0.45); background: #fff; }
.wd-ta::placeholder { color: #c3b2a4; }
.wd-ta--sm { min-height: 68px; font-size: 13.5px; }

/* chips：可横滑、可换行 */
.wd-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.wd-chips--scroll { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.wd-chips--scroll::-webkit-scrollbar { display: none; }
.wd-chip {
  flex: 0 0 auto; padding: 8px 12px; border-radius: 12px; cursor: pointer;
  border: 1px solid #f1e3d7; background: #fffdfb; color: #6f5c4d;
  font-size: 13px; font-weight: 600; font-family: inherit;
  transition: all 0.14s;
}
.wd-chip.on { background: #fff1e6; border-color: rgba(249, 89, 1, 0.5); color: #d24c02; }
.wd-chip:active { transform: scale(0.97); }
.wd-chip small { display: block; margin-top: 2px; font-size: 10.5px; font-weight: 500; color: #b9a696; }
.wd-chip.on small { color: #d98a56; }

.wd-more { margin-top: 10px; }
.wd-more > summary {
  cursor: pointer; list-style: none; font-size: 13px; font-weight: 600; color: #b6602a;
  padding: 7px 0 3px;
}
.wd-more > summary::-webkit-details-marker { display: none; }
.wd-more > summary::after { content: ' ＋'; font-weight: 700; }
.wd-more[open] > summary::after { content: ' －'; }

/* 按钮 */
.wd-act {
  display: block; width: 100%; padding: 14px; border: 0; cursor: pointer;
  border-radius: 15px; font-size: 15.5px; font-weight: 800; font-family: inherit;
  background: var(--grad); color: #fff; box-shadow: 0 8px 20px rgba(249, 89, 1, 0.24);
}
.wd-act:active { transform: scale(0.985); }
.wd-act[disabled] { background: #ecdfd4; color: #a99a8c; box-shadow: none; cursor: default; }
.wd-act--ghost {
  background: #fff; color: #c04f04; border: 1.5px solid rgba(249, 89, 1, 0.4); box-shadow: none;
}
.wd-acts { display: flex; gap: 9px; }
.wd-acts > * { flex: 1 1 0; min-width: 0; }
.wd-note { margin-top: 9px; font-size: 11.5px; line-height: 1.65; color: var(--text2); text-align: center; }
.wd-note b { color: #b6602a; }
.wd-err {
  margin-top: 10px; padding: 11px 13px; border-radius: 12px;
  background: #fdeeee; border: 1px solid #f6dada; color: #c0392b; font-size: 13px; line-height: 1.6;
}

/* ---------------- 上传区 ---------------- */
.wd-drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  padding: 24px 16px; border: 1.5px dashed #ecdacb; border-radius: 16px;
  background: #fffdfb; cursor: pointer; text-align: center;
}
.wd-drop:active { background: #fff7f0; }
.wd-drop b { font-size: 14.5px; font-weight: 700; }
.wd-drop span { font-size: 11.5px; color: var(--text2); line-height: 1.6; }
.wd-drop-ico { font-size: 26px; }
/* 🔴 input[type=file] 必须藏在 label 里（不能 opacity:0 —— 手机上点不到） */
.wd-file { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------------- 体检卡 ---------------- */
.wd-check { display: flex; gap: 13px; align-items: flex-start; }
.wd-score {
  flex: 0 0 auto; width: 62px; height: 62px; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: conic-gradient(#22c55e 0deg, #22c55e var(--deg, 0deg), #f0e6dd var(--deg, 0deg), #f0e6dd 360deg);
  position: relative;
}
.wd-score::after { content: ''; position: absolute; inset: 6px; border-radius: 50%; background: #fff; }
.wd-score b, .wd-score i { position: relative; z-index: 1; font-style: normal; line-height: 1; }
.wd-score b { font-size: 20px; font-weight: 800; color: #2e7d4f; }
.wd-score i { font-size: 10px; color: var(--text2); margin-top: 2px; }
.wd-score.fair { background: conic-gradient(#f0a020 0deg, #f0a020 var(--deg, 0deg), #f0e6dd var(--deg, 0deg), #f0e6dd 360deg); }
.wd-score.fair b { color: #b07d20; }
.wd-score.poor { background: conic-gradient(#ef4444 0deg, #ef4444 var(--deg, 0deg), #f0e6dd var(--deg, 0deg), #f0e6dd 360deg); }
.wd-score.poor b { color: #c0392b; }
.wd-check-main { flex: 1 1 auto; min-width: 0; }
.wd-check-main > b { display: block; font-size: 14.5px; font-weight: 700; }
.wd-check-main > p { margin-top: 3px; font-size: 11.5px; line-height: 1.6; color: var(--text2); }
.wd-issues { margin-top: 10px; display: flex; flex-direction: column; gap: 7px; }
.wd-issue {
  padding: 9px 11px; border-radius: 12px; border-left: 3px solid #f0a020;
  background: #fffaf1; font-size: 12.5px; line-height: 1.6;
}
.wd-issue.high { border-color: #ef4444; background: #fdf4f4; }
.wd-issue.low { border-color: #9ec9a8; background: #f7fbf7; }
.wd-issue b { display: block; font-size: 13px; font-weight: 700; margin-bottom: 2px; }
.wd-issue span { color: #7d6a5b; }
.wd-issue em { display: block; margin-top: 3px; font-style: normal; font-size: 11.5px; color: #a2897a; }
.wd-issue code {
  display: inline-block; margin: 2px 4px 0 0; padding: 1px 6px; border-radius: 6px;
  background: #fff; border: 1px solid #f0e0d0; font-size: 11.5px; color: #a8623a;
  font-family: inherit;
}

/* ---------------- 生成进度（不许假造百分比） ---------------- */
.wd-prog { display: flex; flex-direction: column; gap: 10px; }
.wd-prog-hd { display: flex; align-items: center; gap: 9px; }
.wd-prog-dot {
  width: 9px; height: 9px; border-radius: 50%; background: var(--primary);
  box-shadow: 0 0 0 0 rgba(249, 89, 1, 0.5); animation: wd-pulse 1.5s ease-out infinite;
}
@keyframes wd-pulse {
  0% { box-shadow: 0 0 0 0 rgba(249, 89, 1, 0.42); }
  100% { box-shadow: 0 0 0 13px rgba(249, 89, 1, 0); }
}
.wd-prog-hd b { font-size: 14px; font-weight: 700; }
.wd-prog-hd em { font-style: normal; font-size: 11.5px; color: var(--text2); margin-left: auto; }
/* 骨架屏：只表示"在写"，不做百分比（假进度比没进度更让人恼火） */
.wd-sk { display: flex; flex-direction: column; gap: 7px; margin-top: 2px; }
.wd-sk i {
  display: block; height: 9px; border-radius: 4px;
  background: linear-gradient(90deg, #f4ece5 25%, #fbf6f1 37%, #f4ece5 63%);
  background-size: 400% 100%; animation: wd-sh 1.4s ease infinite;
}
.wd-sk i:nth-child(1) { width: 58%; height: 13px; }
.wd-sk i:nth-child(3) { width: 92%; }
.wd-sk i:nth-child(4) { width: 86%; }
.wd-sk i:nth-child(6) { width: 74%; }
@keyframes wd-sh { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---------------- 成品页：白纸预览（= 下载后的样子） ---------------- */
.wd-paperbar {
  display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
  font-size: 11.5px; color: var(--text2);
}
.wd-paperbar b { font-size: 12.5px; color: #a2897a; font-weight: 700; }
.wd-paperbar i { font-style: normal; margin-left: auto; }
.wd-paper {
  position: relative; padding: 26px 22px; background: #fff; border-radius: 6px;
  box-shadow: 0 6px 26px rgba(58, 42, 30, 0.12), 0 1px 0 rgba(0, 0, 0, 0.04);
  /* 中文字体按"宋体优先"—— 与生成的 Word 一致；手机上落到系统宋体/思源宋体 */
  font-family: "Songti SC", "STSong", "SimSun", "Noto Serif CJK SC", "Source Han Serif SC", Georgia, serif;
  color: #1f1a16; word-break: break-word;
}
.wd-paper::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: linear-gradient(180deg, #f95901 0%, #ffd0ad 100%); border-radius: 6px 0 0 6px;
}
.wd-paper-hd { text-align: center; margin-bottom: 14px; }
.wd-paper-hd b { display: block; font-weight: 700; }
.wd-paper-hd em { display: block; font-style: normal; color: #6b6259; margin-top: 5px; }
.wd-p { text-indent: 2em; text-align: justify; color: #2b241e; }
.wd-h { font-weight: 700; }
.wd-list { margin: 0; padding: 0; list-style: none; }
.wd-list li { display: flex; gap: 6px; }
.wd-list li > i { font-style: normal; flex: 0 0 auto; }
.wd-quote { border-left: 3px solid #e6d8cb; padding-left: 10px; color: #6b6259; }
.wd-sign { text-align: right; }
.wd-gap { height: 10px; }
.wd-tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.wd-tbl th, .wd-tbl td { border: 1px solid #d8cbbf; padding: 5px 7px; text-align: left; }
.wd-tbl th { background: #f5efe9; font-weight: 700; }

/* ---------------- 改动清单 / 待补 ---------------- */
.wd-diff { display: flex; flex-direction: column; gap: 8px; }
.wd-diff-row { padding: 10px 12px; border-radius: 12px; background: #fffdf9; border: 1px solid #f1e5d9; font-size: 12.5px; line-height: 1.65; }
.wd-diff-row .k { color: #a2897a; font-size: 11.5px; }
.wd-diff-row del { color: #b0a094; text-decoration: line-through; }
.wd-diff-row ins { color: #b6560a; text-decoration: none; font-weight: 600; }
.wd-diff-row .why { display: block; margin-top: 4px; color: #9d8a7b; font-size: 11.5px; }
.wd-todos { display: flex; flex-direction: column; gap: 6px; }
.wd-todos div { display: flex; gap: 7px; font-size: 12.5px; line-height: 1.6; color: #8a7263; }
.wd-todos div i { font-style: normal; color: #d98a56; flex: 0 0 auto; }

/* ---------------- 分享面板 ---------------- */
.wd-mask {
  position: fixed; inset: 0; z-index: 62; display: none;
  align-items: flex-end; background: rgba(30, 20, 14, 0.5);
}
.wd-mask.on { display: flex; }
.wd-sheet {
  width: 100%; max-width: 720px; margin: 0 auto; padding: 18px 18px 22px;
  background: #fff; border-radius: 22px 22px 0 0;
  animation: wd-up 0.22s ease-out;
}
@keyframes wd-up { from { transform: translateY(26px); opacity: 0.6; } to { transform: none; opacity: 1; } }
.wd-sheet > b { display: block; font-size: 16px; font-weight: 800; }
.wd-sheet > p { margin-top: 5px; font-size: 12px; line-height: 1.65; color: var(--text2); }
.wd-share-in {
  display: block; width: 100%; margin: 12px 0 10px; padding: 12px 13px;
  border: 1px solid #f0e2d6; border-radius: 13px; background: #fffdfb;
  font-size: 12.5px; color: #b6560a; font-family: inherit;
}
.wd-sheet-hint { margin-top: 9px; font-size: 11.5px; line-height: 1.6; color: var(--text2); text-align: center; }

/* ---------------- toast ---------------- */
.wd-toast {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%) translateY(10px);
  z-index: 70; max-width: 82vw; padding: 10px 16px; border-radius: 999px;
  background: rgba(40, 28, 20, 0.92); color: #fff; font-size: 13px; line-height: 1.5;
  opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; text-align: center;
}
.wd-toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------------- 分享页（免登录那页） ---------------- */
.wd-viewwrap { max-width: 720px; margin: 0 auto; padding: 18px 14px 40px; }
.wd-viewbar {
  display: flex; align-items: center; gap: 8px; margin-bottom: 12px;
  font-size: 12.5px; color: var(--text2);
}
.wd-viewbrand { font-weight: 800; color: #d24c02; }
.wd-viewact { margin-left: auto; display: flex; gap: 8px; }
.wd-viewact a, .wd-viewact button {
  padding: 8px 12px; border-radius: 11px; border: 1px solid rgba(249, 89, 1, 0.35);
  background: #fff; color: #c04f04; font-size: 12.5px; font-weight: 700; cursor: pointer;
  font-family: inherit; text-decoration: none;
}

/* ---------------- 桌面加宽 ---------------- */
@media (min-width: 768px) {
  .wd-wrap { padding: 0 18px 40px; }
  .wd-paper { padding: 40px 46px; }
}

/* ---------------- 「刚才那份」回收条 ----------------
   成品页是 #wdMain 的内容，切 Tab 会被表单替换掉；没有这条，用户切一下就以为文件丢了。 */
.wd-reuse {
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px; padding: 11px 13px;
  border-radius: 15px; background: linear-gradient(135deg, #fff6ef 0%, #ffeadb 100%);
  border: 1px solid rgba(249, 89, 1, 0.18); cursor: pointer;
}
.wd-reuse:active { opacity: 0.8; }
.wd-reuse-ico { font-size: 20px; }
.wd-reuse-txt { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.wd-reuse-txt b { font-size: 13.5px; font-weight: 700; color: #8a4a12; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wd-reuse-txt em { font-style: normal; font-size: 11.5px; color: #b07d55; }
.wd-reuse-go { flex: 0 0 auto; font-size: 12.5px; font-weight: 700; color: #d24c02; }

/* ---------------- 作品卡片上的删除按钮 ----------------
   用户问过"咋删除呀" → 入口必须**看得见**（只做长按/滑动这类隐藏手势等于没有）。
   视觉 24px，热区用 ::after 撑到 40px：手机上点得中，又不挡住缩略图。 */
.wd-hist-del {
  position: absolute; right: 4px; top: 4px; z-index: 2;
  width: 24px; height: 24px; padding: 0; border: 0; cursor: pointer;
  border-radius: 50%; background: rgba(58, 42, 30, 0.42); color: #fff;
  font-size: 15px; line-height: 1; font-weight: 400;
  display: flex; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
.wd-hist-del::after { content: ''; position: absolute; inset: -8px; border-radius: 50%; }
.wd-hist-del:active { background: rgba(192, 57, 43, 0.9); }

/* 危险动作（删除）主按钮 —— 与站内橙色的"主操作"区分开，避免看错点错 */
.wd-act--danger { background: #c0392b; color: #fff; }
.wd-act--danger[disabled] { background: #e3bab4; color: #fff; box-shadow: none; cursor: default; }
.wd-sheet p b { color: #8a4a12; }

/* 超长/长文档的预期提示（分节生成，要等 1—2 分钟）——
   不写这条，用户看到进度停在一句话上会以为页面卡死了 */
.wd-len-tip {
  margin-top: 9px; padding: 9px 11px; border-radius: 11px;
  background: #fffaf0; border: 1px dashed #f0dcb8;
  font-size: 12px; line-height: 1.65; color: #a8701a;
}
.wd-len-tip b { color: #d24c02; }

/* 选中体裁后显示"这类文书通常多长" —— 用户问过"请假条标准应该多少字" */
.wd-tpl-words {
  margin-top: 8px; padding: 8px 11px; border-radius: 11px;
  background: #fffaf0; border: 1px dashed #f0dcb8;
  font-size: 11.5px; line-height: 1.6; color: #a8701a;
}
.wd-tpl-words b { color: #d24c02; }
