/* --- Slider Component Styles --- */
.slider-guidance {
    color: var(--dark-green); /* 使用主题中的深绿色以突出显示 */
    font-style: italic;
}

/* --- Iframe Component Styles --- */
.iframe-container {
    margin: 1.5rem 0;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden; /* Ensures the iframe respects the border radius */
    box-shadow: 0 4px 12px var(--shadow-color);
}

.embedded-iframe {
    display: block; /* Removes any default bottom spacing */
    width: 100%;
    border: none; /* Redundant with frameborder=0, but good practice */
}


/* Styles for form elements, inspired by quiz components */

.form-quiz-option {
    display: flex;
    align-items: center;
    background-color: white;
    padding: 0.8rem 1rem;
    margin: 0.5rem 0;
    border-radius: 6px;
    border: 1px solid #ccc;
    cursor: pointer;
    transition: all 0.2s ease-out;
}

.form-quiz-option:hover {
    border-color: #4CAF50;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.form-quiz-option input,
.form-quiz-option textarea,
.form-quiz-option select {
    margin-right: 0.8rem;
    flex-shrink: 0;
}

.question-container {
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.question-text {
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 15px;
}


.sliders-container {
    display: grid;
    grid-template-columns: 1fr 1fr; /* 两列布局 */
    gap: 15px 20px; /* 行间距和列间距 */
}

.single-slider-container {
    display: grid;
    grid-template-columns: auto 1fr; /* 标签自动宽度，滑块占据剩余空间 */
    align-items: center;
    gap: 10px; /* 标签和滑块之间的间距 */
}

.slider-label {
    font-weight: bold;
    color: var(--text-color);
    text-align: right; /* 标签文本右对齐 */
}

.slider-input {
    width: 100%; /* 滑块占据其容器的全部宽度 */
    max-width: 250px; /* 限制滑块的最大宽度 */
}
/
/
本 CSS 文件已升级为参数化主题架构。
:root 块中定义了所有颜色和样式的变量，作为默认的“清新绿”主题。
JavaScript (render.js) 可以通过直接修改这些根变量来动态切换到任何其他主题，
而无需加载新的CSS文件，实现了高效的主题控制。
/
:root {
/ 主色调 - 可被JS覆盖 */
--primary-green: #4CAF50;
--light-green: #C8E6C9;
--dark-green: #388E3C;

/* 文本与背景 - 可被JS覆盖 */
--text-color: #1B5E20;
--bg-color: #F1F8E9;
--container-bg: #ffffff;
--border-color: #A5D6A7;
--highlight-bg: #E8F5E9;
--button-text-color: white;

/* 次要/重置按钮颜色 - 可被JS覆盖 */
--secondary-color: #81C784;
--secondary-dark-color: #66BB6A;

/* 反馈状态 - 正确 - 可被JS覆盖 */
--feedback-correct-bg: #C8E6C9;
--feedback-correct-text: #2E7D32;
--feedback-correct-border: #81C784;

/* 反馈状态 - 错误 (保持红色以保证清晰度) - 可被JS覆盖 */
--feedback-incorrect-bg: #f8d7da;
--feedback-incorrect-text: #721c24;
--feedback-incorrect-border: #f5c6cb;

/* 反馈状态 - 部分正确 - 可被JS覆盖 */
--feedback-partial-bg: #fff3cd;
--feedback-partial-text: #856404;
--feedback-partial-border: #ffeeba;

/* 阴影 - 可被JS覆盖 */
--shadow-color: rgba(46, 125, 50, 0.15);

}

#graph-container.chart-container {
    min-height: 500px;
    padding: 20px;
    background-color: #f9f9f9;
    position: relative; /* 确保 z-index 生效 */
    z-index: 1; /* 提升层级 */
}

#graph-container .echarts-instance {
    min-height: 460px;
}

ul, ol {
  padding-left: 2rem;
  margin-bottom: 1rem;
}

li {
  margin-bottom: 0.5rem;
}

.nested-list {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

/* Nested list styling */
ul ul, ol ul, ul ol, ol ol {
  padding-left: 1.5rem;
}

ul ul, ol ul {
  list-style-type: circle;
}

ul ul ul, ol ul ul {
  list-style-type: square;
}

ol ol {
  list-style-type: lower-alpha;
}

ol ol ol {
  list-style-type: lower-roman;
}

/* 保证在统一外框内的嵌套列表缩进与层次清晰 */
.interactive-container .nested-list {
  padding-left: 1.5rem;
}
.interactive-container li > .nested-list {
  margin-top: 0.4rem;
}


.click-connect-wrapper {
    display: flex;
    justify-content: space-between;


/* --- Learning Strategy Tip Enhancements --- */
.callout-strategy .callout-title {
    font-size: 1.4em; /* Larger title */
    color: #9a3412; /* Darker, more prominent orange */
    margin-bottom: 15px;
}

.callout-strategy .strategy-name {
    font-weight: 700;
    font-style: normal;
    color: #c2410c;
    margin-bottom: 8px; /* Reduced space */
    font-size: 1.2em; /* Slightly larger than description */
    border-bottom: 2px solid #fdba74; /* Underline to separate */
    padding-bottom: 8px;
}

.callout-strategy .strategy-description {
    font-size: 1em;
    line-height: 1.7;
    margin-bottom: 20px;
    color: #4b5563; /* Softer gray */
    padding-top: 10px; /* Space after underline */
}

.callout-strategy .strategy-steps {
    list-style: none;
    padding-left: 0;
    counter-reset: step-counter;
    border-top: 1px solid #fed7aa; /* Separator line */
    padding-top: 20px;
}

.callout-strategy .strategy-steps li {
    counter-increment: step-counter;
    margin-bottom: 15px; /* More space between steps */
    display: flex;
    align-items: flex-start;
    line-height: 1.6;
}

/* Enhanced Step Counter */
.callout-strategy .strategy-steps li::before {
    content: counter(step-counter);
    background-color: #fb923c; /* A softer, more appealing orange */
    color: white;
    font-weight: bold;
    border-radius: 50%;
    width: 28px; /* Slightly larger */
    height: 28px;
    display: inline-block;
    text-align: center;
    line-height: 28px;
    margin-right: 15px; /* More space */
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}





.separator-after {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.form-field-horizontal {
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-field-horizontal label {
    flex: 0 0 150px; /* Adjust label width as needed */
    text-align: right;
}

.form-field-horizontal input,
.form-field-horizontal textarea,
.form-field-horizontal select {
    flex: 1;
}

fieldset.form-group {
    border: none;
    padding: 0;
    margin: 0;
}

legend.form-label {
    font-weight: bold;
    margin-bottom: 10px;
    padding: 0;
}

.form-option {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.form-option input {
    margin-right: 10px;
}

/* --- Enhanced Form Component Styles --- */
.form-container {
    background-color: var(--container-bg);
    padding: 25px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px var(--shadow-color);
    transition: all 0.3s ease-in-out;
}

.form-field {
    margin-bottom: 20px;
}

.form-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: var(--text-color);
    font-size: 1.05em;
}

.form-field input[type="text"],
.form-field textarea,
.form-field select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-field input[type="text"]:focus,
.form-field textarea:focus,
.form-field select:focus {
    outline: none;
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px var(--light-green);
}

.form-field .checkbox-group,
.form-field .radio-button-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-field .checkbox-item,
.form-field .radio-item {
    display: flex;
    align-items: center;
    padding: 8px;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.form-field .checkbox-item:hover,
.form-field .radio-item:hover {
    background-color: var(--highlight-bg);
}

.form-field .checkbox-item input,
.form-field .radio-item input {
    margin-right: 12px;
    accent-color: var(--primary-green);
}

.form-buttons {
    display: flex;
    justify-content: flex-start;
    gap: 12px;
    margin-top: 25px;
}

.form-buttons button {
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.05em;
    font-weight: bold;
    transition: background-color 0.3s, transform 0.2s;
}

.form-buttons button:hover {
    transform: translateY(-2px);
}

.form-title {
    color: #4CAF50; /* Green from image */
    border-bottom: 2px solid #4CAF50;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.form-field-horizontal input[type="text"],
.form-field-horizontal textarea,
.form-field-horizontal select {
    border: 1px solid #ccc;
}

.form-buttons .submit-button {
    background-color: #4CAF50; /* Green from image */
    color: white;
}

.form-buttons .submit-button:hover {
    background-color: #45a049; /* Darker green */
}

.form-buttons .reset-button {
    background-color: #81C784; /* Lighter green from image */
    color: white;
}

.form-buttons .reset-button:hover {
    background-color: #66BB6A; /* Darker shade of the lighter green */
}

.form-feedback {
    margin-top: 20px;
    padding: 12px;
    border-radius: 6px;
    font-weight: 500;
}

.form-feedback.success {
    background-color: var(--feedback-correct-bg);
    color: var(--feedback-correct-text);
    border: 1px solid var(--feedback-correct-border);
}

.form-feedback.error {
    background-color: var(--feedback-incorrect-bg);
    color: var(--feedback-incorrect-text);
    border: 1px solid var(--feedback-incorrect-border);
}

.callout-reflection {
    /* 外观交由 .interactive-container 提供，这里仅保留内容级样式（如标题等） */
}

.callout-reflection .callout-title {
    font-size: 1.5em; /* Larger title */
    color: #111827; /* Almost black for strong emphasis */
    border-bottom: 2px solid #d1d5db;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.callout-reflection .reflection-prompts {
    list-style: none;
    padding-left: 0;
    margin-top: 20px;
}

.callout-reflection .reflection-prompts li {
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-left: 4px solid #9ca3af; /* Accent line */
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 12px;
    font-size: 1em;
    line-height: 1.6;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
}

.callout-reflection .reflection-prompts li:hover {
    transform: translateY(-2px) scale(1.01); /* Add scaling effect */
    box-shadow: 0 4px 12px 0 rgba(0, 0, 0, 0.08);
    border-left-color: #4b5563; /* Darker accent on hover */
}

.callout-reflection .reflection-prompts li::before {
    content: '»';
    color: #6b7280;
    font-weight: bold;
    margin-right: 15px;
    font-size: 1.4em;
    transition: color 0.2s ease-in-out;
}

.callout-reflection .reflection-prompts li:hover::before {
    color: #1f2937; /* Darker on hover */
}

    position: relative;
    min-height: 300px;
    border: 1px solid #eee;
    border-radius: 8px;
    margin-bottom: 20px;
    padding: 20px;
}

.click-connect-column {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.click-connect-item {
    padding: 10px 15px;
    border: 1px solid #ccc;
    border-radius: 5px;
    cursor: pointer;
    text-align: center;
    background-color: #fff;
    transition: background-color 0.2s, border-color 0.2s;
    z-index: 1;
}

.click-connect-item.is-selected {
    border-color: var(--primary-green);
    background-color: #e8f5e9;
    font-weight: bold;
}

.click-connect-item.is-correct {
    border-color: #4CAF50;
}

.click-connect-item.is-incorrect {
    border-color: #F44336;
}

.click-connect-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* --- [NEW] Concept Connector Styles --- */
.concept-connector-container {
    position: relative;
    min-height: 400px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.concept-workspace {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 350px;
}

.concept-item {
    position: absolute;
    padding: 8px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background-color: white;
    cursor: grab;
    user-select: none;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px var(--shadow-color);
    min-width: 80px;
    text-align: center;
}

.concept-item:hover {
    border-color: var(--primary-green);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px var(--shadow-color);
}

.concept-item.is-selected {
    border-color: var(--dark-green);
    background-color: var(--highlight-bg);
    font-weight: bold;
    box-shadow: 0 0 15px var(--primary-green);
}

.connection-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0; /* Ensure it's behind nodes */
}

.connection {
    stroke: var(--primary-green);
    stroke-width: 3px;
    fill: none;
    transition: stroke 0.2s;
}

.connection:hover {
    stroke: var(--dark-green);
}

.temp-connection {
    stroke: var(--dark-green);
    stroke-width: 2px;
    stroke-dasharray: 5, 5;
    fill: none;
}

.connection-label {
    fill: var(--text-color);
    font-size: 14px;
    font-family: sans-serif;
    text-anchor: middle;
    dominant-baseline: middle;
    pointer-events: none;
    paint-order: stroke;
    stroke: #fff;
    stroke-width: 3px;
    stroke-linecap: butt;
    stroke-linejoin: miter;
}

.relation-popup {
    position: absolute;
    background: white;
    border: 1px solid #ccc;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 15px;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 280px;
    border-radius: 8px;
}

.popup-title {
    font-weight: bold;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
    font-size: 16px;
    color: var(--dark-green);
    margin: -5px 0 5px 0;
}

.relation-popup input {
    width: 100%;
    padding: 8px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

.popup-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 10px;
}

.context-menu {
    position: absolute;
    background: white;
    border: 1px solid #ccc;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 5px;
    z-index: 10;
    border-radius: 5px;
    min-width: 150px;
}

.context-menu button {
    display: block;
    width: 100%;
    padding: 8px 12px;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    font-size: 14px;
    color: #333;
}

.context-menu button:hover {
    background-color: var(--highlight-bg);
    color: var(--dark-green);
}

.feedback-container {
    padding: 10px 15px;
    border-radius: 5px;
    margin-top: 15px;
    text-align: center;
}

.feedback-container.correct {
    background-color: var(--feedback-correct-bg);
    color: var(--feedback-correct-text);
    border: 1px solid var(--feedback-correct-border);
}

.feedback-container.incorrect {
    background-color: var(--feedback-incorrect-bg);
    color: var(--feedback-incorrect-text);
    border: 1px solid var(--feedback-incorrect-border);
}

.quiz-controls .check-answer-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}


/* --- 全局与布局 --- */
html,
body {
height: 100%;
margin: 0;
padding: 0;
}

body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
background-color: var(--bg-color);
color: var(--text-color);
line-height: 1.7;
transition: background-color 0.4s ease, color 0.4s ease;
/* 主题切换动画 */
}

#app {
width: calc(100% - 20px);
height: calc(100% - 20px);
margin: 10px;
box-sizing: border-box;
overflow-y: auto;
padding: 2.5rem;
background-color: var(--container-bg);
border-radius: 12px;
box-shadow: 0 8px 32px var(--shadow-color);
transition: background-color 0.4s ease, box-shadow 0.4s ease;
/* 主题切换动画 */
}

nav {
background: linear-gradient(90deg, var(--primary-green), var(--dark-green));
box-shadow: 0 2px 5px var(--shadow-color);
border-radius: 12px 12px 0 0;
margin: -2.5rem -2.5rem 2.5rem -2.5rem;
display: flex;
justify-content: space-between;
align-items: center;
padding: 0.5rem 2.5rem;
}

nav ul {
list-style: none;
margin: 0;
padding: 0;
text-align: left;
}

nav ul li {
display: inline;
margin: 0 1rem;
}

nav ul li a {
color: var(--button-text-color);
text-decoration: none;
font-weight: 600;
padding: 0.5rem 1rem;
border-radius: 99px;
transition: all 0.2s ease;
}

nav ul li a:hover,
nav ul li a.is-active {
background-color: rgba(255, 255, 255, 0.2);
transform: scale(1.05);
}

h1,
h2,
h3,
h4,
h5 {
color: var(--dark-green);
margin-bottom: 1rem;
font-weight: 700;
}

h1 {
font-size: 2.2rem;
text-align: center;
border-bottom: 4px solid var(--primary-green);
padding-bottom: 0.5rem;
}

h2 {
font-size: 1.8rem;
margin-top: 3.5rem;
border-left: 5px solid var(--primary-green);
padding-left: 1rem;
}

h3 {
font-size: 1.5rem;
border-bottom: 2px solid var(--light-green);
padding-bottom: 0.4rem;
}

h4 {
font-size: 1.25rem;
}

h5 {
font-size: 1.1rem;
}

.button {
background-color: var(--primary-green);
color: var(--button-text-color);
padding: 0.6rem 1.2rem;
border: none;
border-radius: 6px;
cursor: pointer;
font-size: 1rem;
font-weight: 500;
transition: all 0.2s ease;
user-select: none;
}

.button:hover:not(:disabled) {
background-color: var(--dark-green);
transform: translateY(-2px);
box-shadow: 0 4px 10px var(--shadow-color);
}

.button:active:not(:disabled) {
transform: translateY(0);
box-shadow: 0 1px 2px var(--shadow-color);
}

.button.reset-btn {
background-color: var(--secondary-color);
}

.button.reset-btn:hover:not(:disabled) {
background-color: var(--secondary-dark-color);
}

/* --- [NEW] 布局容器样式 (Layout Containers) --- */
.layout-container {
padding: 1rem;
border: 1px dashed var(--border-color);
border-radius: 8px;
margin-bottom: 1rem;
}

.layout-container-wrapper {
/* Purely structural, no extra styles */
}

.layout-container.template-vertical-stack {
display: flex;
flex-direction: column;
gap: 1rem;
}

.layout-container.template-horizontal-flow {
display: flex;
flex-wrap: wrap;
gap: 1rem;
align-items: flex-start;
}

.layout-container.template-two-column-50-50 {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 1rem;
}

.layout-container.template-three-column-33 {
display: grid;
grid-template-columns: 1fr 1fr 1fr;
gap: 1rem;
}

.layout-container.template-four-column-25 {
display: grid;
grid-template-columns: 1fr 1fr 1fr;
gap: 1rem;
}

@media (max-width: 768px) {
.layout-container.template-two-column-50-50,
.layout-container.template-three-column-33,
.layout-container.template-four-column-25 {
grid-template-columns: 1fr;
}
}

.layout-container .component-wrapper {
margin: 0;
}

.layout-container .interactive-container {
margin: 0;
}

/* --- 组件样式 --- */
.interactive-container {
margin: 1.1rem 0;
padding: 1.1rem;
border: 1px solid var(--border-color);
border-radius: 8px;
background-color: var(--container-bg);
box-shadow: 0 4px 6px var(--shadow-color);
position: relative;
}

/* 引导性装饰条：统一外框根据类型显示左侧色条 */
.interactive-container.callout-info::before,
.interactive-container.callout-tip::before,
.interactive-container.callout-warning::before,
.interactive-container.callout-danger::before,
.interactive-container.callout-key-concept::before,
.interactive-container.callout-quote::before,
.interactive-container.callout-strategy::before,
.interactive-container.callout-reflection::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 6px;
  border-radius: 8px 0 0 8px;
}

.interactive-container.callout-info::before { background-color: #2196f3; }
.interactive-container.callout-tip::before { background-color: #4caf50; }
.interactive-container.callout-warning::before { background-color: #ffc107; }
.interactive-container.callout-danger::before { background-color: #dc3545; }
.interactive-container.callout-key-concept::before { background-color: #9c27b0; }
.interactive-container.callout-quote::before { background-color: #607d8b; }
.interactive-container.callout-strategy::before { background-color: #fb923c; }
.interactive-container.callout-reflection::before { background-color: #6b7280; }

/* 让三类组件的外层容器采用并排布局与原始内容结构协调 */
.interactive-container.callout-info,
.interactive-container.callout-tip,
.interactive-container.callout-warning,
.interactive-container.callout-danger,
.interactive-container.callout-key-concept,
.interactive-container.callout-quote,
.interactive-container.callout-strategy,
.interactive-container.callout-reflection {
  display: flex;
  align-items: flex-start;
  gap: 1.2rem;
}

/* 当位于统一外框中时，重置旧的 callout 外观，避免与 .interactive-container 冲突 */
.interactive-container .callout-container {
  margin: 0;
  padding: 0;
  border: none;
  border-left: 0;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
}

/* 中和类型样式的背景与边框，仅保留图标与标题的颜色差异 */
.interactive-container .callout-info,
.interactive-container .callout-tip,
.interactive-container .callout-warning,
.interactive-container .callout-danger,
.interactive-container .callout-key-concept,
.interactive-container .callout-quote,
.interactive-container .callout-strategy,
.interactive-container .callout-reflection {
  background: transparent;
  border: none;
  border-left: 0;
  box-shadow: none;
}

figure {
margin: 1rem 0;
position: relative;
overflow: hidden;
line-height: 0;
}

figcaption {
font-size: 0.9rem;
color: #666;
margin-top: 0.5rem;
line-height: 1.5;
}

.image-container img {
max-width: 100%;
height: auto;
border-radius: 8px;
display: block;
margin: 0 auto;
}

.image-container.zoomable img {
cursor: zoom-in;
}

.question-text {
font-weight: 600;
color: var(--dark-green);
margin: 0 0 1.2rem 0;
font-size: 1.15rem;
}

.quiz-controls {
margin-top: 1.5rem;
display: flex;
gap: 0.5rem;
}

.kwhl-container {
display: flex;
flex-wrap: wrap;
gap: 1rem;
}

.kwhl-column {
flex: 1;
min-width: 200px;
padding: 1rem;
border: 1px solid var(--border-color);
border-radius: 8px;
background-color: var(--highlight-bg);
}

.kwhl-header {
font-weight: 700;
color: var(--dark-green);
padding-bottom: 0.5rem;
margin-bottom: 0.5rem;
border-bottom: 2px solid var(--light-green);
}

.kwhl-list {
list-style-position: inside;
padding-left: 0.5rem;
margin: 0;
font-size: 0.95rem;
}

.kwhl-list li {
margin-bottom: 0.5rem;
}

[data-component-type="collapsible"] .collapsible {
display: flex;
justify-content: space-between;
align-items: center;
width: 100%;
text-align: left;
}

[data-component-type="collapsible"] .collapsible:after {
content: '+';
font-size: 1.5rem;
transition: transform 0.3s ease;
}

[data-component-type="collapsible"] .collapsible.is-active:after {
transform: rotate(45deg);
}

[data-component-type="collapsible"] .content-wrapper {
max-height: 0;
overflow: hidden;
transition: max-height 0.4s ease-in-out;
}

[data-component-type="collapsible"] .content {
padding: 1.5rem;
margin-top: 0;
}

/* --- [NEW] Glossary Component Styles --- */
.glossary-term {
    color: var(--dark-green);
    border-bottom: 2px dotted var(--primary-green);
    cursor: help;
    position: relative;
    font-weight: 600;
}

.glossary-tooltip {
    position: absolute;
    visibility: hidden;
    opacity: 0;
    background-color: #fff;
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 15px;
    z-index: 1010; /* High z-index to appear above other elements */
    width: 300px;
    max-width: 90vw;
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
    font-size: 0.95rem;
    line-height: 1.6;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    pointer-events: none; /* Prevents the tooltip from interfering with mouse events */
}

.glossary-tooltip.is-visible {
    visibility: visible;
    opacity: 1;
}
background: var(--highlight-bg);
border-radius: 0 0 8px 8px;
border: 1px solid var(--border-color);
border-top: none;
}

.deep-question {
border-left: 4px solid var(--primary-green);
padding: 1.2rem 1.5rem;
margin: 2rem 0;
background-color: var(--highlight-bg);
border-radius: 0 8px 8px 0;
}

[data-component-type="flipCard"] {
text-align: center;
}

.flip-card {
display: block;
width: 100%;
height: 180px;
perspective: 1000px;
cursor: pointer;
}

.flip-card-inner {
position: relative;
width: 100%;
height: 100%;
transition: transform 0.6s;
transform-style: preserve-3d;
}

.flip-card.is-flipped .flip-card-inner {
transform: rotateX(180deg);
}

.flip-card-front,
.flip-card-back {
position: absolute;
width: 100%;
height: 100%;
backface-visibility: hidden;
display: flex;
align-items: center;
justify-content: center;
padding: 1rem;
box-sizing: border-box;
border-radius: 12px;
box-shadow: 0 6px 20px var(--shadow-color);
}

.flip-card-front {
background-image: linear-gradient(45deg, var(--light-green), var(--primary-green));
color: white;
font-size: 1.5rem;
font-weight: bold;
}

.flip-card-back {
background-image: linear-gradient(225deg, var(--highlight-bg), var(--light-green));
color: var(--text-color);
transform: rotateX(180deg);

/* --- [NEW] multiChoice Quiz Styles --- */
.feedback-area.is-partial {
    background-color: var(--feedback-partial-bg);
    color: var(--feedback-partial-text);
    border-left: 5px solid var(--feedback-partial-border);
}

.quiz-option.is-correct {
    background-color: var(--feedback-correct-bg);
    border-color: var(--feedback-correct-border);
}

.quiz-option.is-incorrect {
    background-color: var(--feedback-incorrect-bg);
    border-color: var(--feedback-incorrect-border);
}

.is-answered .quiz-option.is-correct-answer {
    background-color: var(--light-green);
    border: 2px solid var(--primary-green);
}

.is-answered .quiz-option input {
    pointer-events: none;
}
}
transform: rotateY(180deg);
}

.page-control-container {
border: 1px solid var(--border-color);
border-radius: 8px;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.page-control-tabs {
display: flex;
padding: 0.5rem 0.5rem 0 0.5rem;
border-bottom: 1px solid var(--border-color);
border-radius: 8px 8px 0 0;
}

.page-control-tab {
padding: 0.7rem 1.2rem;
border: 1px solid var(--border-color);
border-bottom: none;
border-radius: 6px 6px 0 0;
cursor: pointer;
margin-right: 0.25rem;
margin-bottom: -1px;
background-color: transparent;
transition: all 0.2s ease;
}

.page-control-tab:hover {
background-color: var(--highlight-bg);
}

.page-control-tab.is-current {
background-color: var(--container-bg);
border-color: var(--border-color);
border-bottom: 1px solid var(--container-bg);
font-weight: 600;
color: var(--dark-green);
}

.page-control-content-panes {
padding: 1.5rem;
}

.page-control-pane {
display: none;
animation: fadeIn 0.4s;
}

.page-control-pane.is-current {
display: block;
}

.table-container {
overflow-x: auto;
border: 1px solid var(--border-color);
border-radius: 8px;
}

table {
width: 100%;
border-collapse: collapse;
}

caption {
font-weight: 600;
padding: 0.8rem;
font-size: 1.1rem;
color: var(--dark-green);
}

th,
td {
border-bottom: 1px solid var(--border-color);
padding: 1rem;
text-align: left;
}

th {
background-color: var(--highlight-bg);
font-weight: 600;
}

tbody tr:hover {
background-color: var(--highlight-bg);
}

.chart-container {
    background-color: #f9f9f9;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.chart-container .echarts-instance {
    min-height: 400px;
    width: 100%;
}

.chart-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 16px rgba(0, 0, 0, 0.2);
}

/* Specific styles for the concept tree chart */
#tree-water-concepts.chart-container {
    min-height: 500px;
    padding: 10px;
    background-color: #fdfdfd;
}

#tree-water-concepts .echarts-instance {
    min-height: 480px;
}

/* --- 测试组件样式 --- */
.quiz-option {
display: flex;
align-items: center;
background-color: white;
padding: 0.8rem 1rem;
margin: 0.5rem 0;
border-radius: 6px;
border: 1px solid var(--border-color);
cursor: pointer;
transition: all 0.2s ease-out;
}

.quiz-option:hover {
border-color: var(--primary-green);
transform: translateY(-2px);
box-shadow: 0 4px 10px var(--shadow-color);
}

.quiz-option input {
margin-right: 0.8rem;
flex-shrink: 0;
}

.question-container.is-answered .quiz-option {
cursor: not-allowed;
pointer-events: none;
opacity: 0.7;
}

.question-container.is-answered.is-correct .quiz-option input[data-correct="true"]:checked {
accent-color: var(--primary-green);
}

.question-container.is-answered:not(.is-correct) .quiz-option input:checked {
accent-color: #dc3545;
}

.question-container .check-answer-btn {
display: inline-block;
}

.question-container .reset-btn {
display: none;
}

.question-container.is-answered .check-answer-btn {
display: none;
}

.question-container.is-answered .reset-btn {
display: inline-block;
}

.question-container.is-answered.is-correct .reset-btn {
display: none;
}

.feedback-area {
margin-top: 1rem;
padding: 1rem;
border-radius: 6px;
border-width: 1px;
border-style: solid;
display: none;
white-space: normal; 
line-height: 1.6;
}

/* --- [NEW] File Download Component Styles --- */
.file-download-container {
    display: flex;
    align-items: center;
    padding: 1rem;
    border: 1px solid var(--border-color, #A5D6A7);
    border-radius: 8px;
    background-color: #fff;
    transition: all 0.2s ease;
    text-decoration: none;
    color: inherit;
}

.file-download-container:hover {
    border-color: var(--primary-green, #4CAF50);
    box-shadow: 0 4px 12px var(--shadow-color, rgba(46, 125, 50, 0.15));
    transform: translateY(-2px);
}

.file-icon {
    flex-shrink: 0;
    margin-right: 1rem;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-icon svg {
    width: 100%;
    height: 100%;
}

.file-details {
    flex-grow: 1;
    min-width: 0; /* Prevents text overflow issues in flexbox */
}

.file-name {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--dark-green, #388E3C);
    margin: 0;
}

.file-description {
    font-size: 0.9rem;
    color: #555;
    margin: 0.25rem 0 0 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: #777;
    margin-top: 0.5rem;
}

/* Style Variants */

/* List View */
.file-download-list-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color, #A5D6A7);
    text-decoration: none;
    color: inherit;
    transition: background-color 0.2s;
}

.file-download-list-item:last-child {
    border-bottom: none;
}

.file-download-list-item:hover {
    background-color: var(--highlight-bg, #E8F5E9);
}

.file-download-list-item .file-icon {
    width: 32px;
    height: 32px;
    margin-right: 0.75rem;
}

.file-download-list-item .file-details {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-grow: 1;
}

.file-download-list-item .file-name {
    font-size: 1rem;
    flex-grow: 1;
}

.file-download-list-item .file-meta {
    margin-top: 0;
    flex-shrink: 0;
    width: 180px; /* Fixed width for alignment */
    justify-content: space-between;
}

/* Compact View */
.file-download-compact {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: 99px; /* Pill shape */
    background-color: var(--highlight-bg, #E8F5E9);
    border: 1px solid transparent;
    text-decoration: none;
    color: var(--text-color, #1B5E20);
    transition: all 0.2s ease;
}

.file-download-compact:hover {
    border-color: var(--primary-green, #4CAF50);
    background-color: var(--light-green, #C8E6C9);
}

.file-download-compact .file-icon {
    width: 20px;
    height: 20px;
    margin-right: 0.5rem;
}

.file-download-compact .file-name {
    font-size: 0.9rem;
    font-weight: 500;
}

.file-download-compact .file-details,
.file-download-compact .file-meta {
    display: none; /* Hide details in compact view */
}

.feedback-area.is-visible {
display: block;
animation: fadeIn 0.3s;
}

.feedback-area.is-correct {
background-color: var(--feedback-correct-bg);
color: var(--feedback-correct-text);
border-color: var(--feedback-correct-border);
}

.feedback-area.is-incorrect {
background-color: var(--feedback-incorrect-bg);
color: var(--feedback-incorrect-text);
border-color: var(--feedback-incorrect-border);
}

.drag-drop-container {
display: flex;
gap: 1rem;
}

.draggable-items,
.drop-targets {
flex: 1;
padding: 1rem;
border: 1px dashed var(--border-color);
border-radius: 8px;
min-height: 100px;
transition: all 0.2s ease;
}

.draggable {
background-color: white;
padding: 0.8rem;
border: 1px solid var(--border-color);
border-radius: 6px;
cursor: grab;
text-align: center;
margin-bottom: 0.5rem;
transition: all 0.2s ease;
}

.draggable:hover {
transform: scale(1.03);
box-shadow: 0 4px 8px var(--shadow-color);
}

.draggable.is-dragging {
opacity: 0.5;
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
transform: rotate(3deg) scale(1.05);
}

.drop-target-wrapper {
display: flex;
align-items: center;
gap: 0.5rem;
margin-bottom: 0.5rem;
}

.drop-target {
flex-grow: 1;
min-height: 48px;
background: #F8FBF6;
border: 2px dashed var(--border-color);
border-radius: 6px;
transition: all 0.2s;
display: flex;
align-items: center;
justify-content: center;
padding: 0.5rem;
}


/* 拖动匹配：支持一对多、多对一及多对多 */
.draggable {
position: relative;
}

.draggable.is-partially-used::after {
content: attr(data-usage);
position: absolute;
top: 0.3rem;
right: 0.45rem;
padding: 0.05rem 0.35rem;
border-radius: 999px;
font-size: 0.68rem;
font-weight: 700;
line-height: 1.35;
color: var(--theme-title-accent);
background: color-mix(in srgb, var(--theme-title-accent) 12%, white 88%);
}

.drop-target .draggable {
flex: 0 1 auto;
margin: 0;
padding: 0.55rem 0.7rem;
cursor: grab;
}

.drop-target {
flex-wrap: wrap;
justify-content: flex-start;
align-content: flex-start;
gap: 0.45rem;
}

.drop-target:empty { justify-content: center; }
.drop-target.is-correct { border-color: var(--feedback-correct-border); background: var(--feedback-correct-bg); }
.drop-target.is-incorrect { border-color: var(--feedback-incorrect-border); background: var(--feedback-incorrect-bg); }
.drop-target.is-over {
background: var(--highlight-bg);
border-color: var(--primary-green);
border-style: solid;
transform: scale(1.02);
}

.sortable-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sortable-item .drag-handle {
    margin-right: 10px;
    cursor: move;
    color: #ccc;
}

.sortable-item.is-dragging {
    opacity: 0.5;
}

/* NEW: Placeholder Styles */
.placeholder-container {
padding: 2rem;
border: 2px dashed #ccc;
background-color: #f9f9f9;
text-align: center;
color: #777;
border-radius: 8px;
margin: 2rem 0;
}

/* NEW: Media Component Styles */
.media-container video,
.media-container audio {
width: 100%;
border-radius: 6px;
}

.media-container .video-iframe-wrapper {
position: relative;
padding-bottom: 56.25%;
/* 16:9 */
height: 0;
overflow: hidden;
border-radius: 6px;
}

.media-container .video-iframe-wrapper iframe {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}

.media-caption {
text-align: center;
font-style: italic;
color: #666;
margin-top: 0.5rem;
}

.media-title {
margin-bottom: 1rem;
}

/* [REFACTORED & FIXED] Code Block Styles */
.code-block-container {
position: relative;
display: flex;
flex-direction: column;
max-width: 100%;
}

.code-block-container .copy-code-btn {
position: absolute;
top: 1.5rem;
right: 1.5rem;
padding: 0.3rem 0.6rem;
font-size: 0.8rem;
background-color: #e0e0e0;
color: #333;
opacity: 0.7;
transition: opacity 0.2s;
z-index: 2;
}

.code-block-container:hover .copy-code-btn {
opacity: 1;
}

.code-block-content {
display: flex;
background-color: #2d2d2d;
border-radius: 6px;
margin-top: 1rem;
flex-grow: 1;
min-height: 0;
width: 100%;
max-width: 100%;
box-sizing: border-box;
/* 父容器统一滚动，避免出现两个滚动条 */
overflow: auto;
}

.line-numbers-column {
flex-shrink: 0;
padding: 1.5rem 1rem;
background-color: #3a3a3a;
text-align: right;
user-select: none;
color: #888;
}

.line-numbers-column span {
display: block;
font-family: 'Courier New', Courier, monospace;
font-size: 0.95rem;
line-height: 1.5;
}

.code-block-content pre {
flex-grow: 1;
margin: 0;
padding: 1.5rem;
background-color: transparent;
color: #f8f8f2;
font-family: 'Courier New', Courier, monospace;
font-size: 0.95rem;
line-height: 1.5;
white-space: pre;
/* 去除子元素滚动，让父容器统一滚动 */
overflow: visible;
}

.code-block-content code {
font-size: inherit;
line-height: inherit;
white-space: inherit;
}

/* NEW: KWHL Styles */
.kwhl-outer-container .kwhl-title {
text-align: center;
}

/* 浏览模式：隐藏 KWHL 的加号按钮，确保只读展示 */
.kwhl-container .add-kwhl-item-btn {
  display: none !important;
}

/* --- [NEW] Poll Component Styles --- */
.poll-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1.5rem 0;
}

.poll-option {
  display: flex;
  align-items: center;
  padding: 0.8rem 1.2rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s;
}

.poll-option:hover {
  border-color: var(--primary-green);
  background-color: var(--highlight-bg);
}

.poll-option input {
  margin-right: 0.8rem;
  flex-shrink: 0;
  accent-color: var(--primary-green);
}

.poll-option label {
  cursor: pointer;
}

.poll-controls {
  margin-top: 1rem;
}

.poll-results {
    display: none; /* Initially hidden */
    margin-top: 20px;
}

.poll-results-title {
    font-size: 1.2em;
    margin-bottom: 15px;
    color: var(--text-color);
}

.poll-result-bar-wrapper {
    margin-bottom: 12px;
    padding: 10px;
    border-radius: 5px;
    background-color: var(--bg-color);
    transition: background-color 0.3s ease;
}

.poll-result-bar-wrapper.is-selected {
    background-color: var(--highlight-bg); /* Highlight for the user's choice */
    border: 1px solid var(--primary-green);
}

.poll-result-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-size: 0.95em;
}

.poll-result-text {
    font-weight: bold;
    color: var(--text-color);
}

.poll-result-votes {
    font-size: 0.9em;
    color: var(--text-color);
}

.poll-result-bar-container {
    width: 100%;
    background-color: var(--border-color);
    border-radius: 5px;
    height: 28px;
    overflow: hidden;
}

.modal-content {
    display: flex;
    flex-direction: column;
}

.modal-btn {
    margin-top: 1rem;
}

.poll-result-bar {
    height: 100%;
    background-color: var(--primary-green);
    border-radius: 5px 0 0 5px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    color: white;
    font-weight: bold;
    font-size: 0.9em;
    padding-right: 8px;
    white-space: nowrap;
    transition: width 0.5s ease-in-out;
}

.poll-result-percentage {
    padding-left: 8px;
}

@keyframes fadeIn {
from {
opacity: 0;
}

to {
opacity: 1;
}

}

//
/ --- NEW/OPTIMIZED STYLES FOR UPGRADED COMPONENTS (V2.4) --- /
//

/* OPTIMIZED: Timeline Styles (for new structure) */
.timeline-container {
padding-left: 1.5rem;
position: relative;
}

.timeline-container::before {
content: '';
position: absolute;
top: 0;
left: 0;
width: 3px;
height: 100%;
background-color: var(--primary-green);
border-radius: 2px;
}

.timeline-title {
margin-top: 0;
padding-left: 0;
}

.timeline-wrapper {
position: relative;
}

.timeline-event {
position: relative;
padding: 0.5rem 0 2rem 1.5rem;
}

.timeline-marker {
position: absolute;
top: 0.6rem;
left: -25px;
width: 14px;
height: 14px;
background-color: white;
border: 3px solid var(--primary-green);
border-radius: 50%;
z-index: 1;
}

.timeline-date {
font-weight: bold;
color: var(--dark-green);
margin-bottom: 0.25rem;
}

.timeline-content h5 {
margin: 0 0 0.5rem 0;
}

.timeline-content p {
margin: 0;
line-height: 1.6;
}

/* MODIFIED: Image Zoom Modal Styles */
/* MODIFIED: Image Zoom Modal Styles */
.image-zoom-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.85);
z-index: 10000;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}

.image-zoom-wrapper {
width: 100%;
height: 100%;
display: flex;
justify-content: flex-start; /* [MODIFIED] Aligns content to top-left for scrolling */
align-items: flex-start;   /* [MODIFIED] Aligns content to top-left for scrolling */
overflow: auto;
}

.image-zoom-wrapper img {
max-width: none; /* [MODIFIED] Allow JS to control size fully */
transition: width 0.2s, height 0.2s;
}

.zoom-btn {
background: transparent;
border: 1px solid #aaa;
color: white;
width: 40px;
height: 40px;
cursor: pointer;
border-radius: 4px;
display: flex;
justify-content: center;
align-items: center;
transition: background-color 0.2s, border-color 0.2s;
}

.zoom-btn:hover {
background-color: var(--primary-green);
border-color: var(--primary-green);
}

.zoom-btn svg {
width: 24px;
height: 24px;
fill: currentColor;
}

/* NEW: Hotspot Outline for Local Zoom */
.image-zoom-wrapper .hotspot-zoom-outline-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2; /* On top of the image */
}

.image-zoom-wrapper .hotspot-zoom-outline-path {
    fill: transparent;
    stroke: #ffd700; /* Gold/yellow stroke for high contrast */
    stroke-width: 2;
    vector-effect: non-scaling-stroke; /* Keep stroke width consistent on zoom */
}
/* NEW: Generic Fullscreen Styles */
.interactive-container.is-fullscreenable {
cursor: pointer;
}

.interactive-container.is-fullscreenable::after {
content: '双击全屏';
position: absolute;
top: 0.5rem;
right: 0.5rem;
z-index: 5;
background: rgba(255, 255, 255, 0.7);
border: 1px solid var(--border-color);
padding: 0.2rem 0.6rem;
font-size: 0.8rem;
border-radius: 4px;
opacity: 0;
transition: opacity 0.3s;
pointer-events: none;
}

.interactive-container.is-fullscreenable:hover::after {
opacity: 1;
}

.interactive-container.is-fullscreen {
position: fixed;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
background: rgba(255, 255, 255, 0.98);
z-index: 1000;
padding: 2rem;
box-sizing: border-box;
display: flex;
flex-direction: column;
cursor: zoom-out;
margin: 0 !important;
overflow: auto;
}

.interactive-container.is-fullscreen > * {
width: 100% !important;
height: 100% !important;
max-width: none !important;
max-height: none !important;
flex-grow: 1;
min-height: 0;
}

.interactive-container.is-fullscreen::after {
content: '双击退出全屏';
background: var(--dark-green);
color: white;
opacity: 1;
}

/* --- NEW: SVG Hotspot Styles (V4 with Visible Normal State) --- */
.image-with-hotspots {
position: relative;
display: inline-block;
line-height: 0;
}

figure {
position: relative;
overflow: hidden;
text-align: center;
}

.image-hotspot-wrapper {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
pointer-events: none;
}

.hotspot-svg-overlay {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}

.hotspot-svg-overlay a {
pointer-events: auto;
}

/* --- Base Hotspot Group & Path Styles --- */
.hotspot-group {
pointer-events: auto;
cursor: pointer;
}

.hotspot-path,
.hotspot-path-outline {
fill: transparent;
vector-effect: non-scaling-stroke;
transition: all 0.2s ease-in-out;
}

/* --- Normal State: Visible with Subtle High-Contrast Border --- */
.hotspot-path-outline {
stroke: rgba(0, 0, 0, 0.4);
stroke-width: 1.5;
}

.hotspot-path {
stroke: rgba(255, 255, 255, 0.7);
stroke-width: 0.7;
}

/* --- Hover State: Stronger Visual Feedback --- */
.hotspot-group:hover .hotspot-path-outline {
stroke: rgba(0, 0, 0, 0.8);
stroke-width: 3;
}

.hotspot-group:hover .hotspot-path {
stroke: white;
stroke-width: 1.2;
fill: rgba(255, 255, 255, 0.25);
}

/* --- [NEW] Visited/Clicked State --- */
.hotspot-group.is-visited .hotspot-path-outline {
    stroke: rgba(75, 0, 130, 0.8); /* Indigo shadow */
}

.hotspot-group.is-visited .hotspot-path {
    stroke: #9370DB; /* MediumPurple */
    fill: rgba(147, 112, 219, 0.2);
}

.hotspot-icon {
    filter: drop-shadow(0 0 1px rgba(0, 0, 0, 0.8));
    opacity: 0.8;
    transition: all 0.2s ease-in-out;
    pointer-events: none;
    /* 确保图标变换的原点在中心，虽然我们移除了缩放，但这是个好习惯 */
    transform-origin: center center; 
}

.hotspot-group:hover .hotspot-icon {
    opacity: 1;
    filter: drop-shadow(0 0 2px rgba(0,0,0,1));
    /* [移除] transform: scale(1.1); 以防止图标在悬停时移动 */
}

/* [NEW] Visited/Clicked Icon Style */
.hotspot-group.is-visited .hotspot-icon {
    opacity: 1;
    /* This filter combination gives a purple-ish tint to the white SVG icon */
    filter: drop-shadow(0 0 2px #4B0082) sepia(1) saturate(5) hue-rotate(220deg) brightness(1.1);
}

.hotspot-group[data-action="link"] .hotspot-icon {
font-size: 4px;
}

/* --- [REFINED] Callout Styles --- */
.callout-container {
    display: flex; /* Use flexbox for alignment */
    align-items: flex-start; /* Align items to the top */
    gap: 1.2rem; /* Space between icon and text */
    margin: 1.5rem 0;
    padding: 1.2rem 1.5rem;
    border-radius: 8px;
    border-left-width: 0; /* Remove the old left border */
    position: relative;
}

.callout-icon {
    flex-shrink: 0; /* Prevent icon from shrinking */
    width: 24px;
    height: 24px;
    margin-top: 2px; /* Fine-tune vertical alignment */
}

.callout-text-wrapper {
    flex-grow: 1; /* Allow text to take remaining space */
}

.callout-title {
    font-weight: 700;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.callout-content p:last-child {
    margin-bottom: 0;
}

/* Tip */
.callout-tip {
    background-color: #e7f7ec;
    border: 1px solid #a5d6a7;
    color: #1B5E20;
}
.callout-tip .callout-icon {
    background-color: #4CAF50;
}
.callout-tip .callout-title {
    color: #388E3C;
}

/* Warning */
.callout-warning {
    background-color: #fffbe6;
    border: 1px solid #ffe58f;
    color: #856404;
}
.callout-warning .callout-icon {
    background-color: #ffc107;
}
.callout-warning .callout-title {
    color: #b38600;
}

/* Info */
.callout-info {
    background-color: #e7f3ff;
    border: 1px solid #a0cfff;
    color: #004085;
}
.callout-info .callout-icon {
    background-color: #007bff;
}
.callout-info .callout-title {
    color: #0056b3;
}

/* Danger */
.callout-danger {
    background-color: #f8d7da;
    border: 1px solid #f1b0b7;
    color: #721c24;
}
.callout-danger .callout-icon {
    background-color: #dc3545;
}
.callout-danger .callout-title {
    color: #b21f2d;
}

/* [NEW] SVG Icons for Callouts */
.callout-icon {
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
}

.callout-info .callout-icon {
    -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"/></svg>');
    mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"/></svg>');
}

.callout-tip .callout-icon {
    -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M9 21c0 .55.45 1 1 1h4c.55 0 1-.45 1-1v-1H9v1zm3-19C8.14 2 5 5.14 5 9c0 2.38 1.19 4.47 3 5.74V17c0 .55.45 1 1 1h4c.55 0 1-.45 1-1v-2.26c1.81-1.27 3-3.36 3-5.74 0-3.86-3.14-7-7-7z"/></svg>');
    mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M9 21c0 .55.45 1 1 1h4c.55 0 1-.45 1-1v-1H9v1zm3-19C8.14 2 5 5.14 5 9c0 2.38 1.19 4.47 3 5.74V17c0 .55.45 1 1 1h4c.55 0 1-.45 1-1v-2.26c1.81-1.27 3-3.36 3-5.74 0-3.86-3.14-7-7-7z"/></svg>');
}

.callout-warning .callout-icon {
    -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"/></svg>');
    mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"/></svg>');
}

.callout-danger .callout-icon {
    -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"/></svg>');
    mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"/></svg>');
}


/* --- [MODIFIED] Hotspot Popup as Window --- */
/* --- [MODIFIED] Hotspot Popup as Window --- */
.hotspot-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 10010;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

.hotspot-popup-container {
    /* 啟用大小調整並設置基礎样式 */
    position: absolute; 
    overflow: hidden; /* 防止内容在調整大小時溢出 */
    min-height: 80px; /* 新增：保证最小高度 */
    min-width: 250px;
    border: 1px solid #777;
    background-color: var(--container-bg, white); /* 使用主题变量或白色 */
    display: flex;
    flex-direction: column;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 95vw;
    max-height: 90vh;

}

.hotspot-popup-header {
    /* 覆盖默认样式，实现类似 Windows 的标题栏 */
    background-color: var(--dark-green, #388E3C); /* 使用主题颜色 */
    color: white;
    padding: 0 0 0 8px; /* 为左侧图标和右侧控件调整内边距 */
    cursor: grab;
    user-select: none;
    display: flex;
    align-items: center;
    height: 32px;
    flex-shrink: 0;
    border-bottom: none;
}


.hotspot-popup-container.is-maximized .hotspot-popup-header {
    cursor: default; /* 最大化时不可拖动 */
}

/* 确保标题文本不影响拖动 */
.hotspot-popup-header h4 {
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
    flex-grow: 1;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    pointer-events: none; /* 让事件穿透到 header 上 */
    margin: 0;
    min-width: 0; /* 关键：在 flex 布局中允许文本收缩以正确显示 */
}

/* 新增：左侧窗口图标 */
.hotspot-popup-header .window-icon {
    width: 20px;
    height: 20px;
    margin-right: 8px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M4 6h16v2H4zm0 5h16v2H4zm0 5h16v2H4z"/></svg>');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    flex-shrink: 0;
}

/* 新增：右侧窗口控件 */
.hotspot-popup-window-controls {
    display: flex;
    height: 100%;
}

.hotspot-popup-window-controls .window-control {
    width: 46px;
    height: 100%;
    border: none;
    background: transparent;
    color: white;
    font-size: 1.2rem;
    font-family: 'Segoe UI Symbol', sans-serif; /* 确保符号正确显示 */
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hotspot-popup-window-controls .window-control:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.hotspot-popup-window-controls .window-control.close-btn:hover {
    background-color: #e81123;
}

/* 根据窗口状态显示/隐藏最大化和还原按钮 */
.hotspot-popup-container.is-maximized .window-control.maximize-btn {
    display: none;
}
.hotspot-popup-container:not(.is-maximized) .window-control.restore-btn {
    display: none;
}

/* 隐藏旧的关闭按钮 */
.hotspot-popup-close-btn {
    display: none;
}

.hotspot-popup-content {
    padding: 1.5rem;
    overflow-y: auto;
    line-height: 1.6;
    white-space: normal;
    word-break: break-word;
}

.hotspot-popup-content img,
.hotspot-popup-content video {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: 4px;
}

.hotspot-popup-content audio {
    width: 100%;
}

/* 新增：用于调整窗口大小的不可见元素 */
.hotspot-popup-container .resizer {
    position: absolute;
    width: 10px;
    height: 10px;
    z-index: 10;
}
.hotspot-popup-container .resizer.top-left { top: -5px; left: -5px; cursor: nwse-resize; }
.hotspot-popup-container .resizer.top-right { top: -5px; right: -5px; cursor: nesw-resize; }
.hotspot-popup-container .resizer.bottom-left { bottom: -5px; left: -5px; cursor: nesw-resize; }
.hotspot-popup-container .resizer.bottom-right { bottom: -5px; right: -5px; cursor: nwse-resize; }
.hotspot-popup-container .resizer.top { top: -5px; left: 5px; right: 5px; height: 10px; cursor: ns-resize; }
.hotspot-popup-container .resizer.bottom { bottom: -5px; left: 5px; right: 5px; height: 10px; cursor: ns-resize; }
.hotspot-popup-container .resizer.left { top: 5px; bottom: 5px; left: -5px; width: 10px; cursor: ew-resize; }
.hotspot-popup-container .resizer.right { top: 5px; bottom: 5px; right: -5px; width: 10px; cursor: ew-resize; }

/* [NEW] 全局样式修复，确保 position:fixed 弹窗能真正全屏 */
html.hotspot-popup-active,
body.hotspot-popup-active {
    overflow: visible !important;
}

/* [REMOVED] The styles for .hotspot-popup-content.image-zoom-active, .image-zoom-content-wrapper, and .hotspot-popup-zoom-controls have been removed as they are now redundant. */

/* --- [FIX] Hotspot Popup Window Enhancements --- */
.hotspot-popup-content {
    flex-grow: 1; /* 新增：让内容区填满剩余空间 */
    min-height: 0; /* 新增：配合 flex-grow，允许内容区在父容器有固定高度时正确收缩 */
}

/* 2. 修复：最大化时，让遮罩层透明且无内边距，以允许窗口占满全屏 */
.hotspot-popup-overlay.is-window-maximized {
    padding: 0;
    background-color: transparent;
}

/* 3. 修复：最大化后，保持图片和视频的原始宽高比 */
.hotspot-popup-container.is-maximized {
    position: fixed;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border-radius: 0;
    box-shadow: none;
    border: none;
    transition: all 0.2s ease-in-out;
    max-width: none;
    max-height: none;
}

.hotspot-popup-container.is-maximized .hotspot-popup-content {
    display: flex;
    justify-content: center;
    align-items: center;
}
.hotspot-popup-container.is-maximized .hotspot-popup-content img,
.hotspot-popup-container.is-maximized .hotspot-popup-content video {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain; /* 核心属性：保持比例缩放 */
}

/* NEW: Quiz - ClickConnect Styles (Themed) */
.click-connect-wrapper {
display: flex;
justify-content: space-between;
}

/* --- NEW: Interactive Matrix Styles --- */
.interactive-matrix-container {
    margin: 2rem 0;
}

.interactive-matrix-container .matrix-title {
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 1.6rem;
    color: var(--dark-green);
}

.interactive-matrix {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden; /* Ensures border-radius is respected */
    box-shadow: 0 4px 12px var(--shadow-color);
}

.interactive-matrix th,
.interactive-matrix td {
    border: 1px solid var(--border-color);
    padding: 0.8rem 1rem;
    text-align: center;
    vertical-align: middle;
}

.interactive-matrix thead th {
    background-color: var(--highlight-bg);
    font-weight: 700;
    font-size: 1.1rem;
}

.interactive-matrix tbody th {
    background-color: var(--highlight-bg);
    font-weight: 700;
    text-align: left;
    padding-left: 1.5rem;
}

.interactive-matrix td {
    cursor: pointer;
    transition: background-color 0.2s ease;
    position: relative;
}

.interactive-matrix td:hover {
    background-color: var(--highlight-bg);
}

.matrix-cell-clickable {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
}

.matrix-cell-placeholder {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--primary-green);
    transition: transform 0.3s ease;
}

/* JudgementCorrection: error span selected highlight */
.jc-statement .error-span {
    cursor: pointer;
    border-bottom: 2px dashed var(--primary-green);
}
.jc-statement .error-span.is-selected {
    background-color: var(--highlight-bg);
    border-bottom-color: var(--primary-green);
    font-weight: 600;
}

.interactive-matrix td:hover .matrix-cell-placeholder {
    transform: scale(1.2);
}

.matrix-cell-content-wrapper {
    padding: 1rem;
    text-align: left;
}

.interactive-matrix td.has-popup {
    position: relative;
}

.popup-icon {
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 1.2rem;
    color: var(--primary-green);
    cursor: pointer;
}

/* --- NEW: Matrix Popup Styles --- */
.matrix-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 10020; /* Higher than hotspot popup */
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
    animation: fadeIn 0.3s;
}

.matrix-popup-container {
    width: 60vw;
    max-width: 800px;

@keyframes highlight-blink {
    0%, 100% { border-color: var(--primary-green); }
    50% { border-color: transparent; }
}

.highlight-cell {
    animation: highlight-blink 0.5s 2;
    border: 2px solid var(--primary-green);
}
    max-height: 80vh;
    background-color: var(--container-bg);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.matrix-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1.5rem;
    background-color: var(--dark-green);
    color: white;
    flex-shrink: 0;
}

.matrix-popup-header h4 {
    margin: 0;
    font-size: 1.2rem;
    color: white;
}

.matrix-popup-header .close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.8rem;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.matrix-popup-header .close-btn:hover {
    opacity: 1;
}

.matrix-popup-content {
    padding: 1.5rem 2rem;
    overflow-y: auto;
    flex-grow: 1;
}

/* --- Guided Tour Component --- */
.guided-tour-container {
    position: relative;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.guided-tour-title {
    padding: 1rem 1.5rem;
    margin: 0;
    background-color: var(--highlight-bg);
    border-bottom: 1px solid var(--border-color);
}

.guided-tour-image-container {
    position: relative;
    padding: 1rem;
    background-color: #fdfdfd;
}

.guided-tour-wrapper {
    position: relative;
    line-height: 0;
    width: 100%;
    /* 让包裹高度由图片内容自然决定，避免强制拉伸 */
    height: auto;
    display: inline-block;
}

.guided-tour-image {
    width: 100%;
    /* 使用自然高度，确保宽高比不被拉伸 */
    height: auto;
    max-width: 100%;
    display: block;
    object-fit: contain;
}

.guided-tour-svg-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.guided-tour-target-area {
    fill: rgba(0, 0, 0, 0);
    stroke: #FFC107; /* Amber for old steps */
    stroke-width: 2;
    stroke-dasharray: 5, 5;
    vector-effect: non-scaling-stroke;
    transition: all 0.3s ease;
    cursor: pointer;
    pointer-events: auto;
}

.guided-tour-target-area:hover {
    stroke-width: 3;
    stroke: #FFA000; /* Darker amber on hover */
}

.guided-tour-target-area.current-step {
    stroke: var(--primary-green); /* Primary green for the current step */
    stroke-width: 4;
    stroke-dasharray: none;
    fill: rgba(76, 175, 80, 0.2);
    cursor: default;
}

/* NEW: Floating Popup Styles */
.guided-tour-popup {
    position: absolute;
    top: 20px;
    left: 20px;
    background-color: var(--container-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 5px 15px var(--shadow-color);
    z-index: 1001;
    min-width: 300px;
    max-width: 450px;
    display: flex;
    flex-direction: column;
}

.guided-tour-popup.is-dragging {
    user-select: none;
    box-shadow: 0 8px 25px var(--shadow-color);
}

.popup-title {
    padding: 15px;
    background-color: var(--dark-green);
    color: white;
    cursor: move;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.popup-content {
    padding: 1rem;
    max-height: 400px;
    overflow-y: auto;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.popup-content p {
    margin: 0;
    line-height: 1.6;
}

/* Guided Tour tooltip (title-less content) */
.guided-tour-tooltip {
    position: absolute;
    z-index: 1002;
    background-color: var(--container-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 5px 18px var(--shadow-color);
    max-width: min(420px, 80%);
    max-height: 50vh;
    overflow: hidden;
    pointer-events: auto;
}

.guided-tour-tooltip .tooltip-content {
    padding: 10px 12px;
    font-size: 14px;
    line-height: 1.5;
    overflow-y: auto;
    word-break: break-word;
    white-space: normal;
}

.guided-tour-tooltip .tooltip-content::-webkit-scrollbar { width: 8px; }
.guided-tour-tooltip .tooltip-content::-webkit-scrollbar-thumb { background-color: var(--border-color); border-radius: 4px; }
.guided-tour-tooltip .tooltip-content::-webkit-scrollbar-track { background-color: transparent; }

/* Support components and raw HTML inside tooltip */
.guided-tour-tooltip .tooltip-content .interactive-container { margin: 8px 0; }
.guided-tour-tooltip .tooltip-content .interactive-container:last-child { margin-bottom: 0; }
.guided-tour-tooltip .tooltip-content * { pointer-events: auto; }

/* Consistent spacing for popup mixed content */
.guided-tour-popup .popup-content .interactive-container { margin: 12px 0; }
.guided-tour-popup .popup-content .interactive-container:last-child { margin-bottom: 0; }

/* Responsive media inside tooltip/popup */
.guided-tour-popup .popup-content img,
.guided-tour-tooltip .tooltip-content img { max-width: 100%; height: auto; display: block; }

/* Hover title tooltip shown when hovering hotspots */
.guided-tour-hover-tooltip {
    position: absolute;
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    border-radius: 6px;
    font-size: 12px;
    line-height: 1.3;
    pointer-events: none;
    z-index: 1002;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.guided-tour-hover-tooltip.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.guided-tour-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0.75rem;
    margin-top: 1rem;
    border-top: 1px solid var(--border-color);
    background-color: var(--highlight-bg);
    flex-shrink: 0;
}

.guided-tour-nav .button {
    margin: 0 1rem;
}

.guided-tour-nav .step-counter {
    font-weight: 500;
    min-width: 50px;
    text-align: center;
}

.slider-btn {
    padding: 5px 10px;
    cursor: pointer;
    border: 1px solid #ccc;
    background-color: #f0f0f0;
    border-radius: 4px;
    font-size: 16px;
    margin: 0 5px;
}
}

/* --- Quiz Feedback Styles --- */
.quiz-feedback {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 5px;
    font-weight: bold;
}

.quiz-feedback.correct {
    background-color: #E8F5E9; /* Light Green */
    color: #2E7D32; /* Dark Green */
    border: 1px solid #A5D6A7;
}

.quiz-feedback.incorrect {
    background-color: #FFEBEE; /* Light Red */
    color: #C62828; /* Dark Red */
    border: 1px solid #EF9A9A;
}

.quiz-feedback .retry-btn {
    margin-top: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: var(--primary-green);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.quiz-feedback .retry-btn:hover {
    background-color: var(--dark-green);
}

/* Hotspot styles */
.hotspot-image-container {
    position: relative;
    max-width: 100%;
    line-height: 0;
}

.hotspot-image-container img {
    display: block;
    max-width: 100%;
    height: auto;
}

/* 多选模式提示 */
.hotspot-image-container[data-is-multi="true"]::after {
    content: '可多选';
    position: absolute;
    right: 8px;
    bottom: 8px;
    background: rgba(40, 167, 69, 0.9);
    color: #fff;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 4px;
}

.hotspot-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: all;
}

.hotspot-area {
    fill: rgba(0, 123, 255, 0.3);
    stroke: #007bff;
    stroke-width: 2px;
    cursor: pointer;
    pointer-events: all;
    transition: fill 0.2s, stroke 0.2s;
    vector-effect: non-scaling-stroke;
}

.hotspot-area:hover {
    fill: rgba(0, 123, 255, 0.5);
}

.hotspot-area.selected {
    fill: rgba(40, 167, 69, 0.5);
    stroke: #28a745;
}

.quiz-container.is-answered .hotspot-svg {
    pointer-events: none;
}

.quiz-container.is-answered .hotspot-area {
    fill: rgba(128, 128, 128, 0.2);
    stroke: #808080;
}

.quiz-container.is-answered .hotspot-area[data-correct="true"] {
    fill: rgba(40, 167, 69, 0.3);
    stroke: #28a745;
}

.quiz-container.is-answered .hotspot-area.selected[data-correct="true"] {
    fill: rgba(40, 167, 69, 0.7);
    stroke: #1e7e34;
}

.quiz-container.is-answered .hotspot-area.selected:not([data-correct="true"]) {
    fill: rgba(220, 53, 69, 0.7);
    stroke: #dc3545;
}

.quiz-container.is-answered .hotspot-area:not(.selected)[data-correct="true"] {
    fill: rgba(255, 193, 7, 0.5);
    stroke: #ffc107;
}

/* --- [NEW] Argument Mapper Styles --- */
.argument-mapper-container {
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    background-color: var(--container-bg);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.04);
}
```
.argument-mapper-statement {
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 15px;
    color: var(--dark-green);
    border-bottom: 2px solid var(--light-green);
    padding-bottom: 0.5rem;
}

.argument-mapper-workspace {
    display: flex;
    gap: 20px;
    margin-top: 1.5rem;
}

.argument-mapper-items {
    width: 30%;
    border: 1px dashed var(--border-color);
    padding: 10px;
    border-radius: 5px;
    background-color: var(--bg-color);
}

.items-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.items-header h5 {
    margin: 0;
}

.add-item-btn {
    background-color: var(--primary-green);
    color: white;
    border: none;
    border-radius: 4px;
    width: 32px;
    height: 32px;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.argument-mapper-columns {
    width: 70%;
    display: flex;
    gap: 10px;
}

.argument-submit-btn {
    display: block;
    margin: 1rem auto 0;
}

.argument-mapper-column {
    flex: 1;
    border: 1px solid var(--border-color);
    padding: 10px;
    border-radius: 5px;
    background-color: var(--highlight-bg);
    display: flex;
    flex-direction: column;
}

.argument-mapper-column h5 {
    text-align: center;
    margin-top: 0;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--dark-green);
}

.drop-zone {
    background-color: var(--container-bg);
    border: 2px dashed var(--border-color);
    border-radius: 5px;
    padding: 10px;
    transition: background-color 0.3s, border-color 0.3s;
    flex-grow: 1;
}

.drop-zone, .argument-mapper-items {
    min-height: 100px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.drop-zone.is-over {
    background-color: var(--light-green);
    border-color: var(--primary-green);
}

.argument-mapper-container .draggable {
    padding: 10px;
    background-color: var(--container-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin-bottom: 0; /* Remove margin-bottom as gap is used in grid */
    cursor: grab;
    display: flex;
    flex-direction: column; /* Arrange text and controls vertically */
    justify-content: space-between;
    box-shadow: 0 2px 4px var(--shadow-color);
    transition: all 0.2s ease;
    min-height: 80px; /* Ensure a minimum height */
}

.argument-mapper-container .draggable:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px var(--shadow-color);
}

.argument-mapper-container .draggable.is-dragging {
    opacity: 0.5;
    transform: rotate(3deg);
}

.argument-text {
    text-align: left;
    flex-grow: 1;
}

.controls-container {
    display: flex;
    justify-content: flex-end; /* Align controls to the right */
    align-items: center;
    gap: 10px;
}

.vote-btn, .delete-btn {
    background: none;
    border: none;
    cursor: pointer;
    width: 20px;
    height: 20px;
    padding: 0;
}

.vote-btn svg, .delete-btn svg {
    width: 100%;
    height: 100%;
    stroke: var(--text-color);
}

.vote-btn.voted svg {
    fill: var(--feedback-correct-bg);
    stroke: var(--primary-green);
}

.delete-btn svg {
    stroke: #dc3545; /* Standard danger color */
}

.vote-count {
    display: none;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: var(--container-bg);
    padding: 20px;
    border-radius: 5px;
    width: 300px;
    position: relative;
}

.modal-input {
    width: 100%;
    height: 80px;
    margin-bottom: 10px;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.modal-btn {
    width: 100%;
    padding: 10px;
    background-color: var(--primary-green);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.modal-close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-color);
}

/* --- [NEW] Callout Component Styles --- */
.callout-container {
    display: flex;
    align-items: flex-start;
    gap: 1.2rem;
    /* 外观统一由 .interactive-container 提供（margin/padding/border/radius/background/shadow） */
}
/* 新增基础类 .callout，用于内部容器在统一外框中并排布局，不承载外观 */
.callout {
    display: flex;
    align-items: flex-start;
    gap: 1.2rem;
    width: 100%;
}

.callout-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    margin-right: 1rem;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.callout-text-wrapper {
    flex-grow: 1;
    width: 100%;
}

.callout-title {
    font-weight: 700;
    margin-bottom: 0.4rem;
    font-size: 1.1em;
}

.callout-content {
    line-height: 1.7;
}

.callout-source {
    text-align: right;
    font-style: italic;
    margin-top: 0.8rem;
    font-size: 0.9em;
    color: #666;
    margin-left: auto;
    display: block;
    width: 100%;
}

/* Callout Type: Info */
.callout-info {
    background-color: #e7f3fe;
    border-color: #2196f3;
    color: #1c3d5a;
}
.callout-info .callout-icon {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%232196f3"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"/></svg>');
}
.callout-info .callout-title {
    color: #1a78c2;
}

/* Callout Type: Tip */
.callout-tip {
    background-color: #e8f5e9;
    border-color: #4caf50;
    color: #1e4620;
}
.callout-tip .callout-icon {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%234caf50"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zM13 17h-2v-2h2v2zm.25-4.5c-.41.41-.65.93-.65 1.5h-1.2c0-1.1.45-2.1 1.17-2.83.75-.75 1.18-1.74 1.18-2.67 0-1.65-1.35-3-3-3s-3 1.35-3 3h1.2c0-1 .8-1.8 1.8-1.8s1.8.8 1.8 1.8c0 .66-.27 1.26-.75 1.75z"/></svg>');
}
.callout-tip .callout-title {
    color: #388e3c;
}

/* Callout Type: Warning */
.callout-warning {
    background-color: #fff8e1;
    border-color: #ffc107;
    color: #664c00;
}
.callout-warning .callout-icon {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23ffc107"><path d="M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"/></svg>');
}
.callout-warning .callout-title {
    color: #b38600;
}

/* Callout Type: Key Concept */
.callout-key-concept {
    background-color: #f3e5f5;
    border-color: #9c27b0;
    color: #4a148c;
}
.callout-key-concept .callout-icon {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%239c27b0"><path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.25l-6.18 3.77L7 14.14 2 9.27l6.91-1.01L12 2z"/></svg>');
}
.callout-key-concept .callout-title {
    color: #7b1fa2;
}

/* Callout Type: Quote */
.callout-quote {
    background-color: #f5f5f5;
    border-color: #607d8b;
    color: #37474f;
}
.callout-quote .callout-icon {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23607d8b"><path d="M6 17h3l2-4V7H5v6h3zm8 0h3l2-4V7h-6v6h3z"/></svg>');
}
.callout-quote .callout-content {
    font-style: italic;
    font-size: 1.1em;
}

/* --- File Download List Hover --- */
.file-download-list-item .file-description-wrapper {
    position: relative;
}

.file-download-list-item .full-description {
    display: none;
    position: absolute;
    background-color: var(--container-bg);
    border: 1px solid var(--border-color);
    padding: 0.5rem;
    border-radius: 4px;
    z-index: 10;
    width: 100%;
    box-shadow: 0 2px 5px var(--shadow-color);
}

.file-download-list-item .file-description-wrapper:hover .full-description {
    display: block;
}

.file-download-list-item .short-description {
    cursor: pointer;
}


/* --- File Download Compact Hover --- */

/* Default state for compact view */
.file-download-compact {
    position: relative; /* For tooltip positioning */
    display: inline-flex; /* Align icon and name */
    align-items: center;
    gap: 0.5rem;
}

.file-download-compact .file-description,
.file-download-compact .file-meta {
    display: none; /* Hide description and meta by default */
}

/* Hover state for compact view */
.file-download-compact:hover .file-details {
    /* On hover, transform details into a tooltip */
    display: block;
    position: absolute;
    top: 100%; /* Position below the icon/name */
    left: 50%;
    transform: translateX(-50%);
    margin-top: 5px; /* Small gap */
    background-color: var(--container-bg, #fff);
    border: 1px solid var(--border-color, #ccc);
    border-radius: 6px;
    padding: 0.8rem;
    z-index: 10;
    width: max-content;
    min-width: 250px;
    box-shadow: 0 4px 12px var(--shadow-color, rgba(0,0,0,0.1));
    text-align: left;
}

/* On hover, the file name inside the tooltip needs some styling */
.file-download-compact:hover .file-name {
    font-weight: bold;
    margin-bottom: 0.5rem;
}


/* On hover, show description and meta */
.file-download-compact:hover .file-description,
.file-download-compact:hover .file-meta {
    display: block;
}

.file-download-compact .file-description {
    font-size: 0.9rem;
    margin: 0;
}

.file-download-compact .file-meta {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: #666;
}

.file-download-compact > .file-name {
    display: inline-block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px; /* Adjust as needed */
    vertical-align: middle;
}

.file-download-compact .file-details .file-name {
    display: none; /* Hide the truncated name in the tooltip */
}

.file-download-compact .file-details .full-name {
    display: block; /* Show the full name in the tooltip */
    font-weight: bold;
    white-space: normal;
}

/* --- [NEW] File Upload Component Styles --- */
.file-upload-container {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    background-color: var(--container-bg);
    transition: all 0.3s ease;
}

.file-upload-container.is-dragging {
    border-color: var(--primary-green);
    background-color: var(--highlight-bg);
    transform: scale(1.02);
}

.file-upload-label {
    font-weight: 600;
    font-size: 1.2rem;
    color: var(--dark-green);
    margin-bottom: 1rem;
    display: block;
}

.file-drop-zone {
    padding: 2rem 1rem;
    cursor: pointer;
}

.file-drop-zone p {
    margin: 0 0 1rem 0;
    color: #555;
}

.file-upload-input {
    display: none;
}

.upload-btn {
    margin-top: 1rem;
}

.file-list {
    margin-top: 2rem;
    text-align: left;
}

.file-list-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    background-color: var(--highlight-bg);
    border-radius: 6px;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px var(--shadow-color);
}

.file-list-item .file-icon {
    width: 40px;
    height: 40px;
    margin-right: 0.5rem; /* 缩短间距 */
    flex-shrink: 0;
}

.file-list-item .file-info {
    flex-grow: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    text-align: left; /* 文件名左对齐 */
    justify-content: center;
}

.file-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.file-link:hover {
    text-decoration: underline;
}

.file-list-item .file-actions {
    margin-left: 1rem;
}

.delete-btn {
    background: none;
    border: none;
    color: var(--error-color);
    cursor: pointer;
    font-size: 1rem;
}

.hidden {
    display: none;
}

.file-list-item .file-name {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-list-item .file-size {
    font-size: 0.9rem;
    color: #777;
}

.file-list-item .file-actions {
    display: flex;
    align-items: center;
}

.file-list-item .delete-btn {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.5rem;
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background-color: var(--border-color);
    border-radius: 4px;
    margin-top: 0.5rem;
    overflow: hidden;
}

.progress-bar {
    width: 0;
    height: 100%;
    background-color: var(--primary-green);
    transition: width 0.3s ease;
}

.file-status {
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

.file-status.is-uploading {
    color: var(--dark-green);
}

.file-status.is-success {
    color: var(--primary-green);
    font-weight: bold;
}

.file-status.is-error {
    color: #dc3545;
    font-weight: bold;
}

/* --- [NEW] Slider Component Styles --- */
.slider-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--container-bg);
}

.slider-wrapper {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 1rem;
}

.slider-input {
    flex-grow: 1;
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    background: var(--light-green);
    border-radius: 5px;
    outline: none;
    opacity: 0.7;
    transition: opacity .2s;
}

.slider-input:hover {
    opacity: 1;
}

.slider-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    background: var(--primary-green);
    cursor: pointer;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 2px 5px var(--shadow-color);
}

.slider-input::-moz-range-thumb {
    width: 24px;
    height: 24px;
    background: var(--primary-green);
    cursor: pointer;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 2px 5px var(--shadow-color);
}

.slider-value-display {
    font-weight: bold;
    color: var(--dark-green);
    font-size: 1.2rem;
    min-width: 50px;
    text-align: center;
}

.slider-label {
    font-size: 1rem;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.slider-target-component-wrapper {
    width: 100%;
    margin-top: 1rem;
    padding: 1rem;
    border-top: 1px solid var(--border-color);
}

/* New Slider Styles */
.slider-component-container {
    display: flex;
    flex-direction: column;
    align-items: center; /* Center horizontally */
    width: 100%;
}

.slider-interactive-area {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 1rem 0;
}

.slider-track-container {
    position: relative;
    flex-grow: 1;
    min-width: 200px;
    height: 40px; /* Increased height for better interaction */
    display: flex;
    align-items: center;
    margin: 0 1rem;
}

.slider-track {
    position: absolute;
    width: 100%;
    height: 10px; /* Increased height */
    background-color: var(--light-green);
    border-radius: 5px;
    top: 50%;
    transform: translateY(-50%);
}

.slider-ticks {
    position: absolute;
    width: 100%;
    height: 20px; /* Increased height to accommodate ticks below */
    top: 50%;
    transform: translateY(5px); /* Move ticks down */
    pointer-events: none;
}

.slider-tick {
    position: absolute;
    width: 2px;
    background-color: var(--border-color);
    bottom: 0;
}

.slider-tick-major {
    height: 12px;
}

.slider-tick-minor {
    height: 6px;
}

.slider-thumb {
    position: absolute;
    width: 32px;
    height: 40px;
    background-color: transparent; /* Make thumb container transparent */
    cursor: grab;
    display: flex;
    flex-direction: column;
    align-items: center;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    filter: drop-shadow(0 2px 4px var(--shadow-color));
}

.slider-thumb-top {
    width: 100%;
    height: 28px;
    background-color: var(--primary-green);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

.slider-thumb-pointer {
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 12px solid var(--primary-green);
}

.slider-thumb:active {
    cursor: grabbing;
    transform: translateY(-50%) scale(1.05);
}

.slider-value-display {
    color: white;
    font-size: 0.8rem;
    font-weight: bold;
}

.slider-btn {
    background-color: var(--primary-green);
    color: white;
    border: none;
    border-radius: 4px; /* Make it square */
    width: 32px;
    height: 32px;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slider-btn:hover {
    background-color: var(--dark-green);
}

/* Glossary Term Styling */
.glossary-term {
    border-bottom: 2px dotted #007bff; /* Dotted underline to indicate interactivity */
    cursor: pointer;
    position: relative;
    display: inline-block;
}

.glossary-term::after {
    content: attr(data-definition); /* The tooltip content */
    position: absolute;
    bottom: 125%; /* Position above the term */
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    white-space: pre-wrap; /* Allow wrapping within the tooltip */
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    width: max-content;
    max-width: 300px; /* Prevent tooltip from being too wide */
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.glossary-term:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Optional: Arrow for the tooltip */
.glossary-term::before {
    content: '';
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%) translateY(100%); /* Position the arrow */
    border: 8px solid transparent;
    border-top-color: #333;
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    margin-bottom: -16px; /* Overlap with the main tooltip body */
}

.glossary-term:hover::before {
    opacity: 1;
    visibility: visible;
}

/* --- Hotspot Tooltip (Lightweight Mode) --- */
.hotspot-tooltip {
  position: fixed;
  z-index: 10020;
  max-width: 360px;
  background: #ffffff;
  color: #111827;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  padding: 12px 14px;
  pointer-events: auto;
}

.hotspot-tooltip .tooltip-content {
  font-size: 14px;
  line-height: 1.55;
  max-height: 50vh;
  overflow: auto;
  word-wrap: break-word;
}

/* placement helpers; JS 会根据可用空间添加这些类 */
.hotspot-tooltip.is-top { }
.hotspot-tooltip.is-bottom { }
.hotspot-tooltip.is-left { }
.hotspot-tooltip.is-right { }

/* 滚动条优化（可选） */
.hotspot-tooltip .tooltip-content::-webkit-scrollbar { width: 10px; }
.hotspot-tooltip .tooltip-content::-webkit-scrollbar-track { background: transparent; }
.hotspot-tooltip .tooltip-content::-webkit-scrollbar-thumb { background-color: rgba(0,0,0,0.18); border-radius: 6px; border: 2px solid transparent; }

/* --- C4: Fill-in-blank basic styles --- */
.fill-in-blank-text { font-size: 1.1rem; line-height: 2; }
.fill-in-blank-text input.fill-in-blank-input {
    border: none;
    border-bottom: 2px solid var(--primary-green);
    padding: 0.2rem 0.4rem;
    font-size: 1rem;
    min-width: 100px;
    text-align: center;
    background: var(--highlight-bg);
}

/* --- Form Helpers & Layout Overrides for textArea --- */
.form-help {
    display: block;
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 6px;
}

.form-counter {
    display: block;
    font-size: 0.8rem;
    color: #9ca3af;
    margin-top: 4px;
    text-align: right;
}

/* 默认表单字段中的纵向布局覆盖 */
.form-field .form-quiz-option {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 0;
    margin: 0;
    border: 0;
    background: transparent;
    cursor: default;
}

/* 横向布局时换行并将帮助/计数器置于下一行 */
.form-field-horizontal {
    flex-wrap: wrap;
}
.form-field-horizontal .form-help,
.form-field-horizontal .form-counter {
    flex-basis: 100%;
    margin-left: 150px; /* 与标签宽度一致 */
    text-align: right;
}

/* 只读/禁用态样式弱化 */
.form-field textarea[readonly],
.form-field textarea[disabled] {
    background-color: #f3f4f6;
    color: #6b7280;
    cursor: not-allowed;
}

/* 必填星号样式 */
.required-star {
    color: #ef4444;
    margin-left: 4px;
}
.code-block-container .code-rendered-wrapper {
    color: #ffffff;
}
.code-block-container .code-rendered-wrapper mjx-container {
    color: #ffffff;
}
.code-controls-bar {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.code-controls-bar .render-math-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.95em;
}

/* WEBPAGE-EDITOR-TYPOGRAPHY-TABLE-CONTRACT-V1:BEGIN */
/* 编辑器标题层级与表格对齐的统一契约。em 相对于正文继承字号，保证 1～7 级逐级不增大。 */
[data-component-type="heading"][aria-level="1"] { font-size: 2.1667em; }
[data-component-type="heading"][aria-level="2"] { font-size: 1.8333em; }
[data-component-type="heading"][aria-level="3"] { font-size: 1.5em; }
[data-component-type="heading"][aria-level="4"] { font-size: 1.25em; }
[data-component-type="heading"][aria-level="5"] { font-size: 1.125em; }
[data-component-type="heading"][aria-level="6"] { font-size: 1.0625em; }
[data-component-type="heading"][aria-level="7"],
body h7,
body .heading-level-7,
body [data-heading-level="7"] {
    display: block;
    font-size: 1em;
    font-weight: 700;
}

/* 默认表头居中；组件写入的单元格行内对齐仍可覆盖这里的默认值。 */
table th,
.table-container table th,
.interactive-container table th,
.interactive-matrix thead th,
.interactive-matrix tbody th,
.custom-form table th,
form table th {
    text-align: center;
    vertical-align: middle;
}
/* WEBPAGE-EDITOR-TYPOGRAPHY-TABLE-CONTRACT-V1:END */

/* COURSE-FLOATING-NAVIGATION-CONTRACT-V2:BEGIN */
/* 兼容仍使用旧版主题 CSS 的课程：导航必须脱离正文并保持不透明。 */
.page-nav-trigger-button,
.page-share-trigger-button {
    position: fixed;
    top: 5px;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid color-mix(in srgb, var(--border-color) 76%, white 24%);
    border-radius: 14px;
    background: var(--container-bg, #fff);
    color: var(--dark-green);
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.14), 0 4px 14px var(--shadow-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1402;
}

.page-nav-trigger-button { left: 5px; }
.page-share-trigger-button { right: 14px; }

.page-nav-trigger-button:hover,
.page-share-trigger-button:hover,
.page-nav-trigger-button.is-active,
.page-share-trigger-button.is-active {
    background: color-mix(in srgb, var(--container-bg) 70%, var(--highlight-bg) 30%);
    transform: translateY(-1px);
}

.page-floating-action-icon,
.page-floating-action-icon .component-bi-icon {
    width: auto;
    height: auto;
    min-width: 0;
    margin: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    color: inherit;
}

.page-share-panel {
    position: fixed;
    top: 56px;
    right: 14px;
    min-width: 112px;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: var(--container-bg, #fff);
    box-shadow: 0 18px 34px rgba(15, 23, 42, 0.16);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 1401;
}

.page-share-panel.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.page-share-action {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--text-color);
    cursor: pointer;
}

.page-share-action:hover { background: var(--highlight-bg); }

.page-nav-trigger-zone { display: none; }

nav.page-floating-nav {
    position: fixed;
    top: 5px;
    left: 5px;
    z-index: 1399;
    width: min(392px, calc(100vw - 10px));
    max-width: calc(100vw - 10px);
    max-height: min(calc(100vh - 10px), 84vh);
    box-sizing: border-box;
    margin: 0;
    padding: 1rem 0.95rem 0.95rem;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    align-items: stretch;
    justify-content: flex-start;
    overflow: hidden;
    background: var(--container-bg, #fff);
    background-attachment: scroll;
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 22px;
    box-shadow: 0 24px 58px rgba(15, 23, 42, 0.18), 0 10px 30px var(--shadow-color);
    isolation: isolate;
    transform: translate(calc(-100% - 28px), 0);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.22s ease, transform 0.24s ease, box-shadow 0.24s ease;
}

nav.page-floating-nav.is-visible,
nav.page-floating-nav.is-visible:hover,
nav.page-floating-nav.is-visible:focus,
nav.page-floating-nav.is-visible:focus-within {
    background: var(--container-bg, #fff);
    background-attachment: scroll;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translate(0, 0);
}

nav.page-floating-nav * { opacity: 1; }

nav.page-floating-nav::before {
    content: '';
    display: block;
    flex: 0 0 auto;
    height: 5px;
    border-radius: 999px;
    background: var(--primary-green);
}

.page-nav-theme {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.2rem 0 0.9rem;
    border-bottom: 1px solid var(--border-color);
}

.page-nav-theme-label {
    color: var(--dark-green);
    font-size: 0.78rem;
    font-weight: 700;
}

.page-nav-theme-select {
    width: 100%;
    min-height: 42px;
    box-sizing: border-box;
    padding: 0.62rem 0.82rem;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: var(--container-bg, #fff);
    color: var(--text-color);
}

.page-nav-scroll {
    min-height: 0;
    overflow-y: auto;
    padding-right: 0.3rem;
}

nav.page-floating-nav .page-nav-tree,
nav.page-floating-nav .page-nav-tree ul {
    display: block;
    list-style: none;
    margin: 0;
    padding: 0;
    text-align: left;
}

nav.page-floating-nav .page-nav-tree li {
    display: block;
    margin: 0 0 0.28rem;
}

nav.page-floating-nav .page-nav-row {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    align-items: start;
    gap: 0.5rem;
    padding: 0.14rem 0;
    border-radius: 12px;
}

nav.page-floating-nav .page-nav-toggle,
nav.page-floating-nav .page-nav-spacer {
    width: 22px;
    min-width: 22px;
    height: 22px;
    margin: 0;
}

nav.page-floating-nav .page-nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: var(--container-bg, #fff);
    color: var(--dark-green);
    cursor: pointer;
}

nav.page-floating-nav .page-nav-link {
    display: block;
    margin: 0;
    padding: 0.45rem 0.68rem;
    border: 1px solid transparent;
    border-radius: 11px;
    background: transparent;
    color: var(--text-color);
    text-decoration: none;
    line-height: 1.45;
    white-space: normal;
    word-break: break-word;
}

nav.page-floating-nav .page-nav-link:hover,
nav.page-floating-nav .page-nav-link.is-active {
    background: var(--highlight-bg);
    border-color: var(--border-color);
    color: var(--dark-green);
}

nav.page-floating-nav .page-nav-children {
    display: block;
    margin: 0.2rem 0 0.4rem 0.62rem;
    padding-left: 0.9rem;
    border-left: 1px dashed var(--border-color);
}

nav.page-floating-nav .page-nav-item.is-collapsed > .page-nav-children {
    display: none;
}

.page-share-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.5);
}

.page-share-modal {
    position: relative;
    width: min(92vw, 360px);
    padding: 1.4rem 1.25rem 1.1rem;
    border-radius: 20px;
    background: var(--container-bg, #fff);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.26);
    text-align: center;
}

.page-share-modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 999px;
    background: var(--highlight-bg);
    color: var(--text-color);
    cursor: pointer;
}

.page-share-qrcode {
    width: min(72vw, 250px);
    min-height: 250px;
    margin: 0 auto 0.8rem;
    padding: 0.9rem;
    border-radius: 18px;
    background: var(--highlight-bg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-share-qrcode img,
.page-share-qrcode canvas { max-width: 100%; }

@media (max-width: 768px) {
    .page-nav-trigger-button,
    .page-share-trigger-button {
        top: 10px;
        width: 40px;
        height: 40px;
    }

    .page-nav-trigger-button { left: 10px; }
    .page-share-trigger-button { right: 10px; }
    .page-share-panel { top: 56px; right: 10px; }

    nav.page-floating-nav {
        top: 56px;
        left: 10px;
        width: min(320px, calc(100vw - 20px));
        max-height: min(calc(100vh - 68px), 78vh);
    }
}
/* COURSE-FLOATING-NAVIGATION-CONTRACT-V2:END */
