/* 详情页样式 */
.detail-page {
    display: none;
    min-height: 100vh;
    padding-bottom: 110px;
}

.detail-page.active {
    display: block;
}

.detail-header {
    position: sticky;
    top: 0;
    background: var(--bg-white);
    border-bottom: 1px solid #f0f0f0;
    padding: 12px 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    position: relative;
}

.back-btn {
    position: absolute;
    left: 12px;
    width: 24px;
    height: 24px;
    border: none;
    background: none;
    cursor: pointer;
    padding: 0;
}

.back-btn img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.detail-header h2 {
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    margin: 0;
}

.detail-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 12px 120px 12px;
}

.detail-title {
    font-size: 24px;
    font-weight: bold;
    color: var(--text-color);
    margin: 24px 0;
    line-height: 1.4;
}

/* 一级标题样式 */
.big-module {
    font-size: 22px !important;
    font-weight: bold;
    color: #000000;
    margin: 48px 0 32px;
    text-align: center;
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.big-module-text {
    display: inline-block;
}

.big-module-line {
    height: 6px;
    background: #97D3B6;
    margin-top: 6px;
}

/* 媒体原文标题特殊样式 */
.media-title {
    font-size: 22px !important;
    color: #1E4733;
    text-align: center;
    margin: 24px 0 8px;
    line-height: 1.5;
}

/* 二级标题样式 */
.small-title {
    font-size: 18px !important;
    font-weight: bold;
    color: #1E4733;
    margin: 20px 0 12px;
    line-height: 1.5;
}

/* 重置计数器 */
.content-section {
    counter-reset: subtitle;
}

/* 正文样式 */
.text-content {
    font-size: 18px !important;
    line-height: 2;
    color: #333333;
    margin: 12px 0;
}

/* 重点模块样式 */
.highlight-box {
    background: rgba(151, 211, 182, 0.2);
    border-radius: 16px;
    padding: 20px;
    margin: 16px 0;
}

.highlight-box .label {
    font-size: 18px !important;
    color: #1E4733;
    font-weight: 600;
    margin-bottom: 12px;
}

.highlight-box .content {
    font-size: 18px !important;
    line-height: 2;
    color: #1E4733;
}

/* 涉及领域模块 */
.domain-section {
    margin: 20px 0;
}

.domain-item {
    display: block;
    margin-bottom: 8px;
}

.domain-primary {
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 16px !important;
    color: white;
    font-weight: 500;
    display: inline-block;
    background: #97D3B6;
    margin-right: 8px;
}

.domain-secondary {
    display: inline;
}

.domain-secondary-tag {
    font-size: 16px !important;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 4px;
    display: inline-block;
    margin-right: 8px;
    background: rgba(151, 211, 182, 0.2);
    color: #1E4733;
}

.source-info {
    font-size: 13px;
    color: #999;
    text-align: center;
    margin: 4px 0 16px;
}

/* 底部按钮 */
.bottom-actions {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 75px; /* 拓宽1.5倍：50 * 1.5 = 75 */
    background: var(--bg-white);
    padding: 12px 20px;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.08);
    display: flex;
    gap: 12px;
    z-index: 80;
}

.action-btn {
    flex: 1;
    padding: 0;
    height: 51px; /* 拓宽1.5倍：34 * 1.5 = 51 */
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn:active {
    transform: scale(0.98);
}

/* 打卡按钮 - 白底蓝字，较小 */
.action-btn.checkin-btn {
    background: var(--bg-white);
    color: #4482FA;
    border: 1px solid #4482FA;
    flex: 0.7; /* 比默认小 */
}

.action-btn.checkin-btn.checked {
    background: rgba(151, 211, 182, 0.2);
    color: #1E4733;
    border: 1px solid #1E4733;
    cursor: not-allowed;
}

/* 模板按钮 - 白底蓝字，较小 */
.action-btn.empty-pdf-btn {
    background: var(--bg-white);
    color: #4482FA;
    border: 1px solid #4482FA;
    flex: 0.7; /* 比默认小 */
}

/* 导出笔记按钮 - 蓝底白字，最大 */
.action-btn.full-pdf-btn {
    background: #4482FA;
    color: white;
    flex: 1.6; /* 比其他按钮大 */
    font-size: 17px; /* 字体稍大 */
}

.action-btn.primary {
    background: var(--primary-color);
    color: white;
}

.action-btn.primary.checked {
    background: rgba(151, 211, 182, 0.2);
    color: #1E4733;
    cursor: not-allowed;
}

.action-btn.secondary {
    background: var(--bg-white);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

@media (max-width: 768px) {
    .detail-title {
        font-size: 20px;
    }
    
    .big-module {
        font-size: 20px;
    }
}


/* 金句和对策引用样式 */
.quote-box {
    margin: 20px 0;
    font-size: 22px !important;
    line-height: 1.8;
    color: #1E4733;
    position: relative;
}

.quote-box .quote-start {
    display: block;
    font-size: 48px;
    line-height: 1;
    color: #97D3B6;
    margin-bottom: 8px;
}

.quote-box .quote-content {
    font-size: 22px !important;
    line-height: 1.8;
    color: #1E4733;
    padding: 0 20px;
}

.quote-box .quote-end {
    display: block;
    font-size: 48px;
    line-height: 1;
    color: #97D3B6;
    text-align: right;
    margin-top: 8px;
}

/* 打卡成功卡片样式 */
.checkin-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    overflow: hidden;
}

/* 撒花效果 */
.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    top: -10px;
    opacity: 0;
    border-radius: 2px;
    animation: confetti-fall linear forwards;
    pointer-events: none;
}

@keyframes confetti-fall {
    0% {
        top: -10px;
        opacity: 1;
        transform: translateX(0) rotateZ(0deg);
    }
    50% {
        opacity: 1;
    }
    100% {
        top: 100%;
        opacity: 0;
        transform: translateX(calc(var(--random-x, 0) * 100px)) rotateZ(720deg);
    }
}

.checkin-card {
    background: white;
    border-radius: 20px;
    padding: 24px;
    max-width: 400px;
    width: 100%;
    position: relative;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.checkin-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
}

.checkin-close:hover {
    background: #e0e0e0;
}

.checkin-content {
    text-align: center;
    padding: 20px 0;
}

.checkin-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 32px;
}

.checkin-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
    animation: bounceIn 0.6s ease-out;
}

@keyframes bounceIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.checkin-title {
    font-size: 28px;
    font-weight: bold;
    color: #4482FA;
}

.checkin-quote-box {
    margin: 20px 0 32px;
    font-size: 22px !important;
    line-height: 1.8;
    color: #1E4733;
    position: relative;
    text-align: left;
}

.checkin-quote-start {
    font-size: 48px;
    line-height: 1;
    color: #97D3B6;
    margin-bottom: -5px;
    text-align: left;
}

.checkin-quote-content {
    font-size: 22px !important;
    font-weight: bold;
    line-height: 1.8;
    color: #1E4733;
    padding: 0 20px;
    text-align: center;
}

.checkin-quote-end {
    font-size: 48px;
    line-height: 1;
    color: #97D3B6;
    text-align: right;
    margin-top: 10px;
}

.checkin-count {
    font-size: 18px;
    color: #2F3542;
    margin-bottom: 24px;
    font-weight: 500;
}

.checkin-number {
    font-size: 24px;
    font-weight: bold;
    color: #4482FA;
}

.checkin-qrcode {
    display: flex;
    justify-content: center;
    margin-bottom: 12px;
}

.checkin-qrcode img {
    border: 2px solid #f0f0f0;
    border-radius: 8px;
}

.checkin-url {
    font-size: 14px;
    color: #999;
    margin-bottom: 20px;
}

.checkin-save-btn {
    width: 100%;
    padding: 14px;
    background: #4482FA;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.checkin-save-btn:hover {
    background: #3371e9;
}

.checkin-save-btn:active {
    transform: scale(0.98);
}

@media (max-width: 768px) {
    .checkin-card {
        max-width: 90%;
        padding: 20px;
    }
    
    .checkin-header {
        gap: 8px;
        margin-bottom: 24px;
    }
    
    .checkin-icon {
        width: 24px;
        height: 24px;
    }
    
    .checkin-title {
        font-size: 24px;
    }
    
    .checkin-quote-box {
        margin: 16px 0 24px;
    }
    
    .checkin-quote-start,
    .checkin-quote-end {
        font-size: 40px;
    }
    
    .checkin-quote-content {
        font-size: 18px !important;
        padding: 0 10px;
    }
    
    .checkin-count {
        font-size: 16px;
    }
    
    .checkin-number {
        font-size: 20px;
    }
}

/* ── 横版脑图 A→B→C 三列（SVG连线） ── */
.mm-wrap {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 20px auto 28px;
    width: fit-content;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    position: relative;
}

/* SVG overlay，绝对定位覆盖整个 wrap */
.mm-svg {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    overflow: visible;
}

/* A列：根节点 */
.mm-root {
    background: #ffffff;
    color: #1E4733;
    border: 2px solid #96D4B6;
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: bold;
    text-align: center;
    white-space: nowrap;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

/* B+C 列容器 */
.mm-branches {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
    position: relative;
    z-index: 1;
}

/* 每一行：B + C */
.mm-row {
    display: flex;
    align-items: center;
    gap: 0;
}

/* B列：keyword */
.mm-keyword {
    width: 120px;
    background: #96D4B6;
    color: #1E4733;
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.5;
    text-align: left;
    word-break: break-all;
    box-sizing: border-box;
    flex-shrink: 0;
}

/* C列：points */
.mm-points-cell {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-left: 32px;
    min-width: 0;
}

/* point 节点 */
.mm-point {
    width: 120px;
    background: rgba(150, 212, 182, 0.2);
    color: #1E4733;
    border-radius: 8px;
    padding: 6px 8px;
    font-size: 12px;
    line-height: 1.5;
    text-align: left;
    word-break: break-all;
    box-sizing: border-box;
}

/* 旧样式兼容清理 */
.mindmap-wrap, .mindmap-root, .mindmap-keywords,
.mindmap-keyword-col, .mindmap-keyword, .mindmap-point-old,
.mm-center, .mm-side, .mm-branch, .mm-points,
.mm-root-cell, .mm-keyword-cell { display: none; }
