/* Report display primitives — shared by all report pages.
   Family A (section-*): bazi, relationship, vedic.
   Family B (chapter-*): ziwei.
   Loaded AFTER base.css / theme-room.css; page-local CSS loads last and wins. */

:root {
    --report-accent-green: #7ecba1;
    --report-accent-gold: #E8D5A3;
    --report-speaker-name: #7A8A9A;
    --report-error: #ff8a6a;
    --report-divider: rgba(255,255,255,0.12);
    --report-hover: rgba(255,255,255,0.01);
}

/* ===== Generation zone ===== */
.gen-zone { display: none; margin-top: 2rem; padding-top: 2rem; border-top: 1px solid var(--glass-b); }
.gen-zone.show { display: block; padding-bottom: 100px; }
.gen-status-bar { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 1.5rem; }
.gen-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: pulse 1.5s ease-in-out infinite; }
.gen-status-text { font-family: var(--font-mono); font-size: 0.7rem; color: var(--accent); }
.gen-step-text { font-family: var(--font-mono); font-size: 0.62rem; color: var(--text-3); margin-left: auto; }

.followup-loading { padding: 1.5rem 0; }
.followup-shimmer { height: 3px; border-radius: 2px; background: var(--glass-b); overflow: hidden; margin-bottom: 0.8rem; }
.followup-shimmer-bar { width: 40%; height: 100%; border-radius: 2px; background: linear-gradient(90deg, transparent, var(--text-3), transparent); animation: shimmerSlide 1.5s ease-in-out infinite; }
.followup-loading-text { font-family: var(--font-mono); font-size: 0.65rem; color: var(--text-3); letter-spacing: 0.04rem; }

@keyframes shimmerSlide { 0% { transform: translateX(-100%); } 100% { transform: translateX(350%); } }

/* ===== Skeleton loading ===== */
.skel { margin-bottom: 1.5rem; }
.sk { height: 12px; background: linear-gradient(90deg, var(--glass-b) 25%, var(--glass-bh) 50%, var(--glass-b) 75%); background-size: 200% 100%; animation: shimmer 1.8s ease-in-out infinite; border-radius: 4px; margin-bottom: 8px; }
.sk.w100 { width: 100%; } .sk.w80 { width: 80%; } .sk.w60 { width: 60%; } .sk.w40 { width: 40%; }
.sk.thick { height: 16px; margin-bottom: 12px; }

@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@keyframes pulse { 0%, 100% { opacity: 0.4; transform: scale(0.9); } 50% { opacity: 1; transform: scale(1.1); } }

/* ===== Content sections ===== */
.content-sections { display: none; }
.content-sections.show { display: block; }
.bazi-recovery-notice {
    margin: 0 0 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--report-divider);
    font-family: var(--font-mono);
    font-size: 0.68rem;
    line-height: 1.7;
    color: var(--text-3);
}

/* ===== Prologue ===== */
.section-prologue { padding: 1.5rem 0 2rem; margin-bottom: 1rem; border-bottom: 1px dashed var(--glass-b); }
.section-prologue p { font-family: var(--font-body); font-size: 14.5px; font-weight: 400; font-style: italic; line-height: 2.2; color: var(--text); }

/* ===== Section cards ===== */
.section-card { background: transparent; border: none; border-bottom: 1px solid var(--report-divider); margin-bottom: 0; overflow: hidden; overflow-anchor: none; }
.section-card:last-child { border-bottom: none; }
.section-header { padding: 1.2rem 1.5rem; display: flex; align-items: center; cursor: pointer; transition: background 0.2s; }
.section-header:hover { background: var(--report-hover); }
.section-idx { font-family: var(--font-mono); font-size: 0.55rem; color: var(--accent); margin-right: 1rem; min-width: 20px; }
.section-title { font-family: var(--font-head); font-size: 0.88rem; font-weight: 500; color: var(--text); flex: 1; }
.section-summary { font-family: var(--font-body); font-size: 0.72rem; color: var(--text-2); margin-left: 1rem; max-width: 200px; text-align: right; line-height: 1.5; }
.section-toggle { margin-left: 1rem; font-size: 0.7rem; color: var(--text-3); transition: transform 0.3s; }
.section-card.open .section-toggle { transform: rotate(180deg); }
.section-body { max-height: 0; overflow: hidden; transition: max-height 0.5s var(--ease); }
.section-card.open .section-body { max-height: 8000px; }

.followup-question-card {
    display: flex;
    align-items: center;
    gap: 1.15rem;
    padding: 0.95rem 1.2rem;
    margin: 1.5rem 0;
    border: 1px solid var(--glass-b);
    background: var(--glass);
    border-radius: 8px;
    color: var(--text);
}
.followup-idx {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    flex: 0 0 auto;
    min-width: 2.55rem;
    font-family: var(--font-head);
    font-size: 2.35rem;
    font-weight: 200;
    line-height: 1;
    letter-spacing: 0;
    color: var(--text-3);
}
.followup-question-text {
    flex: 1;
    min-width: 0;
    font-family: var(--font-body);
    font-size: 14.5px;
    line-height: 1.75;
    color: var(--text);
}

/* ===== Section content (markdown rendered) ===== */
.section-content { padding: 0 1.5rem 1.5rem; font-family: var(--font-body); font-size: 14.5px; font-weight: 400; line-height: 2; color: var(--text); }
.section-content h2, .section-content h3, .section-content h4 { font-family: var(--font-head); margin: 1.5rem 0 0.5rem; }
.section-content h2 { font-size: 14.5px; font-weight: 600; color: var(--accent); }
.section-content h3 { font-size: 14.5px; font-weight: 600; color: var(--report-accent-green); border-left: 2px solid var(--report-accent-green); padding-left: 0.6rem; }
.section-content h4 { font-size: 14.5px; font-weight: 500; color: var(--text-2); }
.section-content strong { color: var(--report-accent-gold); font-weight: 400; }
.section-content em { color: var(--text); font-style: normal; }
.section-content p { margin-bottom: 0.8rem; }
.section-content ul, .section-content ol { margin: 0.5rem 0 0.8rem 1.5rem; }
.section-content li { margin-bottom: 0.3rem; }
.section-content blockquote {
    border-left: 0 !important;
    padding: 0.65rem 1rem;
    margin: 1rem 0;
    color: var(--text);
    background: var(--glass);
    border-radius: 6px;
}
.section-content hr { display: none; }
.section-content table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: 14.5px; }
.section-content th, .section-content td { border: 1px solid var(--glass-b); padding: 0.6rem; text-align: left; }
.section-content th { background: var(--glass); color: var(--text); font-weight: 500; }

/* ===== Speaker quotes ===== */
.speaker-block { margin: 1rem 0; padding: 1rem 1.2rem; border-left: none; background: var(--glass); border-radius: 8px; display: flex; gap: 0.8rem; align-items: flex-start; }
.speaker-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex-shrink: 0; border: 1px solid var(--glass-b); margin-top: 0.15rem; }
.speaker-body { flex: 1; min-width: 0; }
.speaker-name { font-family: var(--font-head); font-size: 0.825rem; font-weight: 700; letter-spacing: 0.1rem; text-transform: uppercase; color: var(--report-speaker-name); margin-bottom: 0.3rem; }
.speaker-text { font-size: 14.5px; line-height: 1.9; color: var(--text); }
@media (max-width: 768px) {
    .speaker-block { gap: 0.5rem; }
    .speaker-avatar { width: 24px; height: 24px; }
}

/* ===== Export button ===== */
.btn-export-img { font-family: var(--font-mono); font-size: 0.6rem; color: var(--text-3); background: none; border: 1px solid var(--glass-b); border-radius: 4px; padding: 0.3rem 0.6rem; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; margin-left: 0.5rem; transition: all 0.2s; }
.btn-export-img:hover { border-color: var(--glass-bh); color: var(--text-2); }

/* ===== Recommended questions ===== */
.rec-questions { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--glass-b); display: none; }
.rec-questions.show { display: block; }
.rec-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.8rem; }
.rec-label { font-family: var(--font-mono); font-size: 0.744rem; letter-spacing: 0.1rem; text-transform: uppercase; color: var(--text-3); }
.rec-shuffle { background: none; border: 1px solid var(--glass-b); border-radius: 6px; padding: 5px 10px; cursor: pointer; display: flex; align-items: center; gap: 5px; color: var(--text-3); font-family: var(--font-mono); font-size: 0.66rem; transition: all 0.2s; }
.rec-shuffle:hover { border-color: var(--accent); color: var(--accent); }
.rec-shuffle svg { transition: transform 0.3s; }
.rec-shuffle:active svg { transform: rotate(180deg); }
.rec-item { display: block; width: 100%; text-align: left; background: none; border: none; padding: 0.55rem 0; font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-2); cursor: pointer; transition: color 0.2s; border-bottom: 1px solid var(--report-divider); }
.rec-item:last-child { border-bottom: none; }
.rec-item:hover { color: var(--accent); }
.rec-item .rec-num { color: var(--text-3); margin-right: 1rem; display: inline-block; min-width: 24px; }

/* ===== Sections toolbar (expand/collapse + clear memory) ===== */
.sections-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.sections-toggle { font-family: var(--font-mono); font-size: 0.6rem; color: var(--text-3); background: none; border: 1px solid var(--glass-b); border-radius: 6px; padding: 5px 12px; cursor: pointer; transition: all 0.3s; display: inline-block; }
.sections-toggle:hover { border-color: var(--accent); color: var(--accent); }

/* ===== Chapter cards (ziwei family) ===== */
.chapter-card { background: var(--glass); border: 1px solid var(--glass-b); border-radius: 12px; margin-bottom: 10px; overflow: hidden; transition: border-color 0.3s; }
.chapter-card:hover { border-color: var(--glass-bh); }
.chapter-header { padding: 1rem 1.5rem; display: flex; align-items: center; gap: 1rem; }
.chapter-idx { font-family: var(--font-mono); font-size: 0.55rem; color: var(--accent); min-width: 24px; }
.chapter-name { font-family: var(--font-head); font-size: 0.85rem; font-weight: 500; color: var(--text); flex: 1; }
.chapter-status { font-family: var(--font-mono); font-size: 0.6rem; color: var(--text-3); }
.chapter-btn { padding: 6px 16px; border-radius: 6px; font-family: var(--font-head); font-size: 0.7rem; font-weight: 600; cursor: pointer; transition: all 0.3s; border: none; }
.chapter-btn-gen { background: var(--accent); color: var(--bg); }
.chapter-btn-gen:hover { opacity: 0.85; }
.chapter-btn-view { background: var(--glass-bh); color: var(--text); }
.chapter-btn-view:hover { opacity: 0.85; }
.chapter-btn-loading { background: var(--glass-b); color: var(--text-3); cursor: wait; }
.chapter-body { max-height: 0; overflow: hidden; transition: max-height 0.5s var(--ease); }
.chapter-card.open .chapter-body { max-height: none; }
.chapter-content { padding: 0 1.5rem 1.5rem; font-family: var(--font-body); font-size: 0.88rem; font-weight: 400; line-height: 2; color: var(--text-2); }
.chapter-content h3 { font-family: var(--font-head); font-size: 0.82rem; font-weight: 600; color: var(--text); margin: 1.5rem 0 0.5rem; }
.chapter-content strong { color: var(--gold); font-weight: 400; }
.chapter-content em { color: var(--accent); font-style: normal; }
.chapter-content p { margin: 0.85rem 0 1rem; }
.chapter-content ul { list-style: none; padding-left: 0; margin: 0.7rem 0 1.1rem; display: grid; gap: 0.58rem; }
.chapter-content li { position: relative; margin: 0; padding-left: 1rem; }
.chapter-content li::before { content: '-'; position: absolute; left: 0; color: var(--gold); }
.chapter-content .annual-item-head { color: var(--text); margin-top: 1.35rem; }
.chapter-content .chapter-error { color: var(--report-error); }
.chapter-content .followup-question { color: var(--accent); margin-bottom: 0.8rem; }
