/* ============================================================
   知微风水复刻站 · 二期模块补充样式（二）
   三合罗盘 compass-* / 寻奇实验室 xunqi-* / 通用阅读 cp-*
   AI 解说弹层 zwai-* / 报告弹层 rpt-*
   ============================================================ */

/* ============ 罗盘 / 寻奇 共用 ============ */
.cp-row { display: flex; gap: 18px; align-items: stretch; flex-wrap: wrap; }
.cp-read-main { flex: 1; min-width: 300px; }
.cp-tip {
  font-size: 12px; color: var(--text-faint); line-height: 1.7;
  margin-top: 8px; display: flex; gap: 6px; align-items: flex-start;
}
.cp-tip i { color: var(--gold); margin-top: 2px; }

/* ============ 三合罗盘 compass ============ */
.compass-page { max-width: 1000px; margin: 0 auto; }
.compass-panel { padding: 24px; }
.compass-canvas-wrap {
  position: relative; width: 100%; max-width: 560px; margin: 0 auto;
  aspect-ratio: 1 / 1; cursor: grab; touch-action: none;
}
.compass-canvas-wrap.dragging { cursor: grabbing; }
.compass-canvas { width: 100%; height: 100%; display: block; }
.compass-deg-row {
  display: flex; align-items: center; justify-content: center;
  gap: 12px; margin-top: 14px; flex-wrap: wrap;
}
.compass-deg-row .field { display: flex; align-items: center; gap: 8px; }
.compass-deg-row .field-input { width: 100px; text-align: center; }
.compass-cross-x, .compass-cross-y {
  position: absolute; background: rgba(201, 168, 76, 0.55); pointer-events: none;
}
.compass-cross-x { left: 0; right: 0; height: 1px; top: 50%; }
.compass-cross-y { top: 0; bottom: 0; width: 1px; left: 50%; }
.compass-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px; margin-top: 20px;
}
.cp-shan {
  padding: 10px 12px; border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.2); border: 1px solid var(--line-soft);
}
.cp-shan b { color: var(--gold-light); margin-right: 8px; }
.cp-shan span { font-size: 12px; color: var(--text-dim); }

/* ============ 寻奇实验室 xunqi ============ */
.xunqi-page { max-width: 1000px; margin: 0 auto; }
.xunqi-panel { padding: 24px; }
.xunqi-canvas-wrap {
  position: relative; width: 100%; max-width: 520px; margin: 0 auto;
  aspect-ratio: 1 / 1; cursor: grab; touch-action: none;
}
.xunqi-canvas-wrap.dragging { cursor: grabbing; }
.xunqi-canvas { width: 100%; height: 100%; display: block; }
.xunqi-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px; margin-top: 18px;
}
.xunqi-dun {
  padding: 12px 14px; border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.2); border: 1px solid var(--line-soft);
}
.xunqi-dun h4 {
  font-size: 13px; color: var(--gold); letter-spacing: 0.08em;
  margin-bottom: 8px; display: flex; align-items: center; gap: 8px;
}
.xunqi-dun .xq-read { font-size: 12px; color: var(--text-dim); line-height: 1.8; }

/* ============ AI 引经据典解说弹层 zwai ============ */
.zwai-mask {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(5, 10, 8, 0.72); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: zwaiFade 0.2s ease-out;
}
@keyframes zwaiFade { from { opacity: 0; } to { opacity: 1; } }
.zwai-panel {
  width: 560px; max-width: 94vw; height: 560px; max-height: 84vh;
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--ink-panel); border: 1px solid var(--gold-dim);
  box-shadow: var(--shadow), var(--glow-gold);
}
.zwai-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(31, 90, 77, 0.5), rgba(16, 25, 23, 0.5));
}
.zwai-title { font-family: var(--font-display); font-size: 15px; color: var(--gold-light); letter-spacing: 0.06em; }
.zwai-title i { color: var(--gold); margin-right: 6px; }
.zwai-close {
  width: 28px; height: 28px; border-radius: 8px; border: none;
  background: rgba(255, 255, 255, 0.06); color: var(--text); font-size: 18px; line-height: 1;
}
.zwai-close:hover { color: var(--vermilion-light); }
.zwai-body {
  flex: 1; overflow-y: auto; padding: 16px 18px;
  display: flex; flex-direction: column; gap: 12px;
}
.zwai-msg { display: flex; }
.zwai-user { justify-content: flex-end; }
.zwai-bubble {
  max-width: 82%; padding: 10px 14px; border-radius: 14px;
  font-size: 13.5px; line-height: 1.8; white-space: pre-wrap; word-break: break-word;
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line-soft);
  color: var(--text);
}
.zwai-user .zwai-bubble {
  background: linear-gradient(135deg, rgba(201, 168, 76, 0.22), rgba(201, 168, 76, 0.1));
  border-color: var(--gold-dim); color: var(--text-hi);
}
.zwai-input {
  display: flex; gap: 10px; padding: 12px 16px;
  border-top: 1px solid var(--line);
}
.zwai-q {
  flex: 1; padding: 10px 14px; border-radius: 12px;
  background: rgba(0, 0, 0, 0.3); border: 1px solid var(--line);
  color: var(--text-hi); outline: none; font-size: 14px;
}
.zwai-q:focus { border-color: var(--gold); }

/* ============ 报告美化 / 分享 rpt ============ */
.rpt-mask {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(5, 10, 8, 0.75); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  overflow-y: auto;
}
.rpt-paper {
  width: 680px; max-width: 96vw; margin: auto;
  background: linear-gradient(160deg, #fbf6ea 0%, #f4ecd8 100%);
  color: #2c2417; border-radius: 6px; padding: 40px 44px;
  position: relative; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}
.rpt-paper::before {
  content: ""; position: absolute; inset: 0; border-radius: 6px;
  border: 1px solid rgba(156, 126, 68, 0.45);
  box-shadow: inset 0 0 40px rgba(156, 126, 68, 0.08);
  pointer-events: none;
}
.rpt-head { text-align: center; border-bottom: 1px solid rgba(156, 126, 68, 0.4); padding-bottom: 16px; margin-bottom: 20px; }
.rpt-title { font-family: var(--font-display); font-size: 24px; letter-spacing: 0.2em; color: #6b4d1f; }
.rpt-h { font-family: var(--font-display); font-size: 17px; color: #6b4d1f; letter-spacing: 0.1em; margin: 16px 0 8px; }
.rpt-p { font-size: 13.5px; line-height: 1.9; color: #3a3225; margin: 6px 0; }
.rpt-meta { display: flex; gap: 8px; margin: 4px 0; font-size: 13px; }
.rpt-meta-k { color: #8a6d33; min-width: 72px; }
.rpt-meta-v { color: #2c2417; }
.rpt-list { list-style: none; padding: 0; }
.rpt-list li { font-size: 13.5px; line-height: 1.9; color: #3a3225; padding-left: 16px; position: relative; }
.rpt-list li::before { content: "◆"; position: absolute; left: 0; color: #b08a3e; font-size: 10px; top: 6px; }
.rpt-body { margin-bottom: 16px; }
.rpt-seal-holder { display: flex; justify-content: center; margin: 20px 0; }
.rpt-seal-holder canvas { display: block; }
.rpt-foot { text-align: center; border-top: 1px solid rgba(156, 126, 68, 0.4); padding-top: 14px; margin-top: 12px; }
.rpt-foot-text { font-size: 12px; color: #8a6d33; letter-spacing: 0.1em; }
.rpt-actions { position: sticky; bottom: 0; display: flex; justify-content: center; gap: 12px; padding: 14px 0 0; }
.rpt-close {
  position: absolute; top: 12px; right: 14px; width: 30px; height: 30px;
  border-radius: 50%; border: 1px solid rgba(156, 126, 68, 0.5);
  background: rgba(156, 126, 68, 0.12); color: #6b4d1f; font-size: 16px;
}
.rpt-close:hover { background: rgba(156, 126, 68, 0.25); }
