/**
 * comprehension.css — Understanding the Text 问答区块样式
 *
 * 与 interactive.css 风格统一，独立文件不修改原有样式。
 *
 * 部署路径：/wp-content/mu-plugins/hnc-teaching-resources/assets/css/comprehension.css
 */

/* ================================================================== */
/*  段落级「显示翻译」按钮                                             */
/* ================================================================== */

.hnc-comprehension-zh-toggle {
    display: table !important;
    width: auto !important;
    margin: 6px auto 2px;
    padding: 4px 16px;
    font-size: 13px;
    border-radius: 8px;
    border: 1px solid #94a3b8;
    background-color: #f1f5f9 !important;
    color: #475569 !important;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.hnc-comprehension-zh-toggle:hover,
.hnc-comprehension-zh-toggle:focus-visible {
    background-color: #1d4ed8 !important;
    color: #ffffff !important;
    border-color: #1d4ed8;
    outline: none;
}

/* ================================================================== */
/*  Understanding the Text 区块                                        */
/* ================================================================== */

.hnc-comprehension-section {
    margin-top: 24px;
    padding: 20px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

.hnc-comprehension-heading {
    margin: 0 0 16px;
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
    padding-bottom: 12px;
    border-bottom: 2px solid #e2e8f0;
}

/* ================================================================== */
/*  问题列表                                                           */
/* ================================================================== */

.hnc-comprehension-list {
    display: grid;
    gap: 10px;
}

.hnc-comprehension-item {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.hnc-comprehension-item:hover {
    border-color: #cbd5e1;
}

.hnc-comprehension-item.expanded {
    border-color: #93c5fd;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

/* ================================================================== */
/*  问题标题栏                                                         */
/* ================================================================== */

.hnc-comprehension-item-header {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 14px 16px;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s ease;
}

.hnc-comprehension-item-header:hover {
    background: #eff6ff;
}

.hnc-comprehension-number {
    flex-shrink: 0;
    font-weight: 700;
    color: #1d4ed8;
    font-size: 26px !important;
    line-height: 1.85;
    min-width: 32px;
}

.hnc-comprehension-prompt {
    flex: 1;
    font-size: 26px !important;
    line-height: 1.85;
    color: #1e293b;
}

.hnc-comprehension-arrow {
    flex-shrink: 0;
    font-size: 12px;
    color: #94a3b8;
    margin-top: 4px;
    transition: transform 0.2s ease;
}

/* ================================================================== */
/*  内容区（默认收起）                                                 */
/* ================================================================== */

.hnc-comprehension-item-body {
    display: none;
    padding: 0 16px 16px;
}

.hnc-comprehension-item.expanded .hnc-comprehension-item-body {
    display: block;
}

/* 问题中文翻译 */
.hnc-comprehension-prompt-cn {
    margin: 0 0 12px;
    font-size: 22px !important;
    line-height: 1.8;
    color: #64748b;
    font-style: italic;
    padding: 8px 12px;
    background: #f1f5f9;
    border-radius: 8px;
    border-left: 3px solid #cbd5e1;
}

/* 参考答案标签 */
.hnc-comprehension-answer-label {
    font-size: 22px !important;
    font-weight: 600;
    color: #1d4ed8;
    margin-bottom: 6px;
}

/* 英文答案 */
.hnc-comprehension-answer-en {
    margin: 0 0 12px;
    font-size: 26px !important;
    line-height: 1.85;
    color: #1e293b;
    padding: 12px 14px;
    background: #ffffff;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

/* 📍 定位原文按钮 */
.hnc-comprehension-locate-btn {
    display: inline-block;
    padding: 4px 12px;
    font-size: 13px;
    border-radius: 8px;
    border: 1px solid #3b82f6;
    background-color: #eff6ff !important;
    color: #1d4ed8 !important;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    margin-bottom: 6px;
    margin-right: 6px;
}

.hnc-comprehension-locate-btn:hover,
.hnc-comprehension-locate-btn:focus-visible {
    background-color: #1d4ed8 !important;
    color: #ffffff !important;
    border-color: #1d4ed8;
    outline: none;
}

/* 查看中文翻译按钮 */
.hnc-comprehension-answer-cn-toggle {
    display: inline-block;
    padding: 4px 12px;
    font-size: 13px;
    border-radius: 8px;
    border: 1px solid #94a3b8;
    background-color: #f1f5f9 !important;
    color: #475569 !important;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    margin-bottom: 6px;
}

.hnc-comprehension-answer-cn-toggle:hover,
.hnc-comprehension-answer-cn-toggle:focus-visible {
    background-color: #1d4ed8 !important;
    color: #ffffff !important;
    border-color: #1d4ed8;
    outline: none;
}

/* 中文答案（默认隐藏） */
.hnc-comprehension-answer-cn {
    display: none;
    margin: 6px 0 0;
    font-size: 24px !important;
    line-height: 1.85;
    color: #334155;
    padding: 10px 12px;
    background: #f1f5f9;
    border-radius: 8px;
    border-left: 3px solid #cbd5e1;
}

.hnc-comprehension-answer-cn.visible {
    display: block;
}

/* ================================================================== */
/*  控制按钮                                                           */
/* ================================================================== */

.hnc-comprehension-controls {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
}

.hnc-comprehension-ctrl-btn {
    font-size: 13px !important;
    padding: 5px 12px !important;
}

/* ================================================================== */
/*  原文高亮 + Q 标签                                                  */
/* ================================================================== */

mark.hnc-source-highlight {
    background-color: #fefce8;
    border-left: 3px solid #3b82f6;
    padding: 1px 2px;
    border-radius: 3px;
    transition: background-color 1s ease;
}

mark.hnc-source-highlight.hnc-source-highlight-active {
    background-color: #fef08a;
}

.hnc-source-q-tag {
    position: absolute;
    top: -22px;
    left: 0;
    display: inline-block;
    padding: 4px 10px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
    color: #ffffff;
    background-color: #3b82f6;
    border-radius: 6px;
    white-space: nowrap;
    cursor: pointer;
    z-index: 10;
    user-select: none;
    -webkit-tap-highlight-color: rgba(59, 130, 246, 0.3);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

/* ================================================================== */
/*  移动端适配                                                         */
/* ================================================================== */

@media (max-width: 768px) {
    .hnc-comprehension-section {
        padding: 16px;
        border-radius: 12px;
    }

    .hnc-comprehension-heading {
        font-size: 18px;
    }

    .hnc-comprehension-item-header {
        padding: 12px 14px;
    }

    .hnc-comprehension-prompt {
        font-size: 15px;
    }

    .hnc-comprehension-answer-en {
        font-size: 15px;
        padding: 10px 12px;
    }
}

/* Q标签点击后问题闪烁提示 */
.hnc-comprehension-item-flash {
    animation: hnc-q-flash 0.5s ease 3;
}

@keyframes hnc-q-flash {
    0%, 100% { border-color: #93c5fd; }
    50% { border-color: #2563eb; box-shadow: 0 0 12px rgba(37, 99, 235, 0.3); }
}

/* Q标签 hover 效果 */
.hnc-source-q-tag:hover {
    transform: scale(1.15);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
}
