/* ==========================================================================
   个人使用说明书 · personal-manual.css（与 self-explore / life-goal 同源，前缀 pm-）
   ========================================================================== */

/* ---- 页首引言不换行（窄屏允许换行防溢出） ---- */
.page-hero .lead { white-space: nowrap; }
@media (max-width: 860px) { .page-hero .lead { white-space: normal; } }

/* ---- 使用建议：标题不换行 + 四卡一排（窄屏降级） ---- */
.pm-usage .section-head .h2 { white-space: nowrap; }
@media (max-width: 860px) { .pm-usage .section-head .h2 { white-space: normal; } }
.pm-usage .cards {
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.pm-usage .card h3 { font-size: 0.98rem; }
.pm-usage .card p { font-size: 0.85rem; line-height: 1.65; }
@media (max-width: 1100px) { .pm-usage .cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .pm-usage .cards { grid-template-columns: 1fr; } }

/* ---- hidden 兜底：防止全局 .btn 等 display 规则覆盖 hidden 属性 ---- */
[hidden] { display: none !important; }

/* 布局：说明书正文 + 侧栏 */
.pm-grid {
  display: grid;
  grid-template-columns: 1.8fr 1fr;
  gap: 28px;
  align-items: start;
}
@media (max-width: 960px) {
  .pm-grid { grid-template-columns: 1fr; }
  .pm-aside { order: -1; }
}

/* 章节块 */
.pm-form .dim-block {
  border: 0;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  padding: 26px 0 10px;
  margin: 0 0 8px;
}
.pm-form .dim-block:first-child { border-top: 0; padding-top: 4px; }
.pm-form legend {
  padding: 0;
  margin-bottom: 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  width: 100%;
}
.pm-form .dim-num {
  font-size: 0.85rem;
  font-weight: 700;
  color: rgba(0, 0, 0, 0.35);
  letter-spacing: 0.08em;
}
.pm-form legend h3 { margin: 0; font-size: 1.15rem; }
.pm-form .dim-tip {
  width: 100%;
  font-size: 0.85rem;
  line-height: 1.7;
  opacity: 0.6;
}

/* 字段行 */
.q-row {
  border-left: 3px solid transparent;
  padding: 10px 0 10px 14px;
  margin: 0 0 14px;
  transition: border-color 0.2s;
}
.q-row.answered { border-left-color: #0a7d66; }
.q-text {
  font-size: 0.95rem;
  line-height: 1.7;
  margin: 0 0 8px;
  font-weight: 600;
}
.q-text .f-num {
  color: rgba(0, 0, 0, 0.4);
  font-weight: 700;
  margin-right: 6px;
  font-variant-numeric: tabular-nums;
}
.q-row textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 64px;
  padding: 10px 12px;
  font: inherit;
  font-size: 0.92rem;
  line-height: 1.65;
  color: inherit;
  background: rgba(0, 0, 0, 0.025);
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 10px;
  resize: vertical;
  transition: border-color 0.2s, background 0.2s;
}
.q-row textarea:focus {
  outline: none;
  border-color: #0a7d66;
  background: #fff;
}
.q-row textarea::placeholder { color: rgba(0, 0, 0, 0.32); }

/* 侧栏 */
.pm-aside .result-hero { text-align: center; margin-bottom: 18px; }
.pm-aside .big-number { font-size: 2.6rem; font-weight: 800; line-height: 1.1; }
.pm-aside .big-number .of { font-size: 1rem; font-weight: 600; opacity: 0.45; margin-left: 4px; }
.pm-progress {
  height: 6px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.08);
  overflow: hidden;
  margin: 12px auto 8px;
  max-width: 220px;
}
.pm-progress-bar {
  height: 100%;
  border-radius: 4px;
  background: #0a7d66;
  transition: width 0.35s ease;
}

/* 章节进度明细 */
.dim-grid { display: flex; flex-direction: column; gap: 8px; margin: 16px 0; }
.dim-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
}
.dim-row .dim-name { flex: 1; }
.dim-row .dim-count { opacity: 0.55; font-variant-numeric: tabular-nums; }
.dim-row .dim-mini {
  flex: 1.4;
  height: 5px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.08);
  overflow: hidden;
}
.dim-row .dim-mini > i {
  display: block;
  height: 100%;
  background: #0a7d66;
  transition: width 0.3s ease;
}
.dim-row.done .dim-count { color: #0a7d66; font-weight: 700; opacity: 1; }

/* 操作按钮 */
.pm-actions { display: flex; flex-direction: column; gap: 10px; margin: 18px 0 10px; }
.pm-actions .pm-btn-2 {
  background: transparent;
  border: 1px solid rgba(10, 125, 102, 0.45) !important;
  color: #0a7d66;
}
.pm-actions .pm-btn-2:hover { background: rgba(10, 125, 102, 0.08); }
.quiet-btn {
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 999px;
  padding: 9px 20px;
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
  color: inherit;
  opacity: 0.7;
  transition: opacity 0.2s;
}
.quiet-btn:hover { opacity: 1; }

.pm-privacy {
  font-size: 0.78rem;
  line-height: 1.7;
  opacity: 0.55;
  margin: 10px 0 22px;
}

/* 写完之后 CTA */
.pm-cta {
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 14px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pm-cta h4 { margin: 0; font-size: 1rem; }
.pm-cta p { margin: 0; font-size: 0.85rem; opacity: 0.7; }
.pm-cta .btn { text-align: center; }
/* 描边次按钮：必须显式给深色文字——全局 .btn.life 是白字，
   若只把背景改透明，白字会「悬停才可见」 */
.pm-cta .pm-cta-2 {
  background: transparent;
  border: 1px solid rgba(10, 125, 102, 0.45);
  color: #0a7d66;
}
.pm-cta .pm-cta-2:hover { background: rgba(10, 125, 102, 0.08); }

/* 导出反馈提示 */
.pm-export-note {
  font-size: 0.8rem;
  line-height: 1.6;
  margin: 4px 0 0;
  opacity: 0.75;
}

/* ---- 打印版式（打印 / 存 PDF）----
   打印 sheet 由 JS 在点击「打印」时生成，插入 body 末尾；
   屏幕上隐藏，打印时隐藏页面其余部分、只显示 sheet */
.pm-print-sheet { display: none; }

@media print {
  body > *:not(.pm-print-sheet) { display: none !important; }
  .pm-print-sheet {
    display: block !important;
    font-family: inherit;
    color: #000;
    line-height: 1.7;
  }
  .pm-print-sheet .ps-chapter {
    page-break-inside: avoid;
    margin: 14pt 0 8pt;
  }
  .pm-print-sheet .ps-chapter h3 {
    font-size: 13pt;
    margin: 0 0 8pt;
    border-bottom: 1pt solid #999;
    padding-bottom: 3pt;
  }
  .pm-print-sheet .ps-field { margin: 0 0 8pt; page-break-inside: avoid; }
  .pm-print-sheet .ps-label { font-weight: 700; font-size: 10.5pt; margin: 0 0 2pt; }
  .pm-print-sheet .ps-content {
    font-size: 10.5pt;
    margin: 0;
    white-space: pre-wrap;
  }
  .pm-print-sheet .ps-empty { color: #aaa; }
  .pm-print-sheet .ps-meta {
    font-size: 9pt;
    color: #666;
    margin: 0 0 14pt;
  }
  .pm-print-sheet h1 { font-size: 20pt; margin: 0 0 4pt; }
}

/* 窄屏允许 lead 换行：单行 nowrap 在移动端会横向溢出（2026-09-22 全站视觉打磨） */
@media (max-width: 680px) {
  .page-hero .lead,
  .lead { white-space: normal; }
}

/* ==========================================================================
   从其他工具带入素材（2026-11-05）
   目的：说明书的 18 个字段必须是用户自己的话，所以不自动填表——
        只把他在别的工具里写过的东西摆出来，点「带入」再点格子放进去。
   ========================================================================== */
.pm-import .section-head .h2 { white-space: nowrap; }
@media (max-width: 860px) { .pm-import .section-head .h2 { white-space: normal; } }

.pm-import .pm-src-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 24px;
}
@media (max-width: 980px) { .pm-import .pm-src-list { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .pm-import .pm-src-list { grid-template-columns: 1fr; } }

.pm-import .pm-src-card {
  display: flex;
  flex-direction: column;
  padding: 18px 18px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.pm-import .pm-src-from {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--life);
  margin-bottom: 8px;
}

.pm-import .pm-src-text {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--ink);
  white-space: pre-line;
}

.pm-import .pm-src-sub {
  margin: 6px 0 0;
  font-size: 0.75rem;
  line-height: 1.55;
  color: var(--ink-soft);
}

.pm-import .pm-src-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 14px;
}

.pm-import .pm-src-fit {
  font-size: 0.72rem;
  color: var(--ink-soft);
  opacity: 0.85;
}

.pm-import .pm-src-btn {
  flex: none;
  padding: 5px 12px;
  font-size: 0.78rem;
  color: var(--life);
  background: transparent;
  border: 1px solid var(--life);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.pm-import .pm-src-btn:hover { background: var(--life); color: #fff; }

/* 选中目标格子模式 */
body.pm-picking #manualForm textarea.pm-target {
  border-color: var(--life);
  border-style: dashed;
  background: rgba(8, 80, 65, 0.03);
  cursor: pointer;
}
body.pm-picking #manualForm textarea.pm-target:hover {
  background: rgba(8, 80, 65, 0.08);
  border-style: solid;
}

.pm-pick-bar {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 12px 10px 18px;
  font-size: 0.85rem;
  color: #fff;
  background: var(--life);
  border-radius: 999px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.16);
}
.pm-pick-bar .pm-pick-cancel {
  padding: 3px 12px;
  font-size: 0.8rem;
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}
.pm-pick-bar .pm-pick-cancel:hover { background: rgba(255, 255, 255, 0.28); }
