/* General Body and App Container Styles */
body {
    font-family: 'Inter', sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: #f3f4f6; /* Light gray background */
    margin: 0; /* Reset default margin */
}

.app-container {
    display: flex;
    flex-grow: 1;
    position: relative; /* For fixed sidebar positioning */
    padding-top: 64px; /* Height of the fixed header */
}

/* Header Styles */
header {
    background-color: #2563eb; /* Blue background */
    color: white;
    padding: 0 20px; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    height: 64px; 
    display: flex;
    align-items: center;
    justify-content: space-between; /* Changed from center to space-between */
    position: fixed; 
    top: 0;
    left: 0;
    right: 0;
    z-index: 60; 
}

header .header-left {
    display: flex;
    align-items: center;
}

header h1 {
    font-size: 1.75rem; 
    margin-left: 60px; /* Space for toggle button */
}

.home-button-container {
    display: flex;
    align-items: center;
}

.home-button {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
}

/* Sidebar Styles */
.sidebar {
    width: 280px; 
    background-color: #1f2937; 
    color: #e5e7eb; 
    padding: 20px 0;
    transition: width 0.3s ease, padding-left 0.3s ease, padding-right 0.3s ease;
    height: calc(100vh - 64px); /* Full viewport height minus header */
    position: fixed; 
    top: 64px; /* Below header */
    left: 0;
    z-index: 50;
    overflow-y: auto; 
    display: flex;
    flex-direction: column;
}

.sidebar.collapsed {
    width: 0;
    padding-left: 0; 
    padding-right: 0;
    overflow: hidden;
}

.sidebar-toggle-container {
    position: fixed; 
    top: 12px; /* Adjust to vertically center with header text */
    left: 15px;
    z-index: 100; 
    cursor: pointer; 
}

#sidebar-toggle { 
    background: none;
    border: none;
    color: white; 
    font-size: 24px; /* Hamburger icon size */
    padding: 8px;
    line-height: 1; 
}

.sidebar nav {
    flex-grow: 1;
}

.sidebar .chapter-group .chapter-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    color: #d1d5db; 
    text-decoration: none;
    font-weight: 600; /* semibold */
    transition: background-color 0.2s, color 0.2s;
    cursor: pointer;
    border-left: 3px solid transparent;
}

.sidebar .chapter-group .chapter-title:hover,
.sidebar .chapter-group .chapter-title.active-link {
    background-color: #374151; /* Gray 700 */
    color: white;
    border-left-color: #3b82f6; /* Blue 500 */
}

.sidebar .chapter-group .chapter-title .arrow {
    transition: transform 0.3s ease;
    font-size: 0.8em;
}

.sidebar .chapter-group .chapter-title.open .arrow {
    transform: rotate(90deg);
}

.sidebar .sub-sections {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background-color: #111827; /* Gray 900 */
}

.sidebar .sub-sections.open {
    max-height: 500px; /* Adjust as needed for number of subsections */
}

.sidebar .sub-sections a {
    display: block;
    padding: 10px 20px 10px 40px; /* Indented */
    color: #9ca3af; /* Gray 400 */
    text-decoration: none;
    font-size: 0.9em;
    transition: background-color 0.2s, color 0.2s;
    border-left: 3px solid transparent;
}

.sidebar .sub-sections a:hover,
.sidebar .sub-sections a.active-link {
    background-color: #374151; /* Gray 700 */
    color: white;
    border-left-color: #60a5fa; /* Blue 400 */
}

/* Main Content Area Styles */
.main-content-area {
    flex-grow: 1;
    padding: 20px;
    margin-left: 280px; 
    transition: margin-left 0.3s ease;
    background-color: #f3f4f6; /* Gray 100 */
}

.main-content-area.sidebar-collapsed {
    margin-left: 0;
}

/* Content Block Styles (for dynamically loaded content) */
#dynamic-content-wrapper.content-block { 
    padding: 25px;
    border-radius: 12px; 
    background-color: white;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.07); 
    margin-bottom: 25px; 
}
#dynamic-content-wrapper.content-block:last-child { 
    margin-bottom: 0;
}

#dynamic-content-wrapper h2 { 
    font-size: 1.75rem; 
    font-weight: 600; 
    color: #1d4ed8; 
    border-bottom: 2px solid #3b82f6; 
    padding-bottom: 10px;
    margin-bottom: 20px;
}
#dynamic-content-wrapper h3 {
    font-size: 1.5rem; 
    font-weight: 600; 
    color: #1e40af; 
    margin-top: 25px;
    margin-bottom: 15px;
}
#dynamic-content-wrapper p, 
#dynamic-content-wrapper ul li, 
#dynamic-content-wrapper ol li {
    line-height: 1.7; 
    color: #374151; 
    margin-bottom: 1rem; 
}
#dynamic-content-wrapper ul, 
#dynamic-content-wrapper ol {
    margin-left: 20px; 
    margin-bottom: 1rem;
}
#dynamic-content-wrapper ul { list-style-type: disc; }
#dynamic-content-wrapper ol { list-style-type: decimal; }
#dynamic-content-wrapper code { 
    background-color: #e0e7ff; 
    color: #3730a3; 
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}
#dynamic-content-wrapper strong { font-weight: 600; }

/* Interactive Element Styles (within dynamic content) */
#dynamic-content-wrapper .interactive-element {
    border: 1px solid #d1d5db; 
    padding: 20px;
    margin-top: 25px;
    border-radius: 8px;
    background-color: #f9fafb; 
}
#dynamic-content-wrapper .interactive-element h4 {
    font-size: 1.25rem; 
    font-weight: 600; 
    color: #15803d; 
    margin-bottom: 15px;
}

/* Quiz Option Styles (within dynamic content) */
#dynamic-content-wrapper .quiz-option {
    cursor: pointer;
    padding: 10px 15px;
    border: 1px solid #d1d5db; 
    border-radius: 6px;
    margin-bottom: 10px;
    transition: background-color 0.2s, border-color 0.2s;
}
#dynamic-content-wrapper .quiz-option:hover {
    background-color: #e0e7ff; 
    border-color: #6366f1; 
}
#dynamic-content-wrapper .correct-answer { color: #16a34a; font-weight: bold; } 
#dynamic-content-wrapper .wrong-answer { color: #dc2626; font-weight: bold; } 

/* Quiz Option Button Styles */
#dynamic-content-wrapper .quiz-option-button {
    padding: 8px 16px;
    border: 1px solid #cbd5e1; /* slate-300 */
    border-radius: 6px;
    background-color: #f1f5f9; /* slate-100 */
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
    font-size: 0.9rem;
    margin: 2px; /* Added for spacing if they wrap */
}
#dynamic-content-wrapper .quiz-option-button:hover {
    background-color: #e2e8f0; /* slate-200 */
    border-color: #94a3b8; /* slate-400 */
}
#dynamic-content-wrapper .quiz-option-button.correct-button {
    background-color: #dcfce7 !important; /* green-100 */
    border-color: #22c55e !important; /* green-500 */
    color: #15803d !important; /* green-700 */
    pointer-events: none;
}
#dynamic-content-wrapper .quiz-option-button.wrong-button {
    background-color: #fee2e2 !important; /* red-100 */
    border-color: #ef4444 !important; /* red-500 */
    color: #b91c1c !important; /* red-700 */
    pointer-events: none;
}


/* Prev/Next Navigation Buttons (within dynamic content) */
#dynamic-content-wrapper .content-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb; 
}
#dynamic-content-wrapper .nav-button {
    background-color: #4f46e5; 
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600; 
    cursor: pointer;
    transition: background-color 0.3s;
    text-decoration: none; 
}
#dynamic-content-wrapper .nav-button:hover {
    background-color: #4338ca; 
}
#dynamic-content-wrapper .nav-button:disabled {
    background-color: #a5b4fc; 
    cursor: not-allowed;
}

/* Back to Top Button Styles */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: rgba(59, 130, 246, 0.8); /* 增加透明度 */
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px); /* 添加背景模糊效果 */
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background-color: rgba(37, 99, 235, 0.9); /* 悬停时稍微减少透明度 */
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.back-to-top:active {
    transform: translateY(0);
}

/* Footer Styles */
footer {
    background-color: #374151; 
    color: #e5e7eb; 
    text-align: center;
    padding: 20px; 
}

/* 悬浮知识图谱按钮样式 */
.knowledge-graph-float-btn {
    position: fixed;
    right: 30px;
    bottom: 160px; /* 调整到更高位置，避免遮挡导航按钮 */
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.8), rgba(139, 92, 246, 0.8)); /* 增加透明度 */
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 24px;
    cursor: grab;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    backdrop-filter: blur(10px); /* 添加背景模糊效果 */
}

.knowledge-graph-float-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.9), rgba(124, 58, 237, 0.9)); /* 悬停时稍微减少透明度 */
}

.knowledge-graph-float-btn:active {
    transform: translateY(0);
}

.knowledge-graph-float-btn.dragging {
    cursor: grabbing;
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    z-index: 1001;
}

/* 知识图谱模态框样式 */
.knowledge-graph-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.knowledge-graph-modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.knowledge-graph-modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    height: 85%;
    max-width: 1200px;
    max-height: 800px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(1);
    transition: transform 0.3s ease;
}

.knowledge-graph-modal.hidden .knowledge-graph-modal-content {
    transform: scale(0.9);
}

.knowledge-graph-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border-radius: 12px 12px 0 0;
}

.knowledge-graph-modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #1f2937;
}

.close-btn {
    background: none;
    border: none;
    font-size: 28px;
    color: #6b7280;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background-color: #f3f4f6;
    color: #374151;
}

.knowledge-graph-modal-body {
    flex: 1;
    padding: 0;
    overflow: hidden;
}

#knowledge-graph-iframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 0 0 12px 12px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .knowledge-graph-float-btn {
        right: 20px;
        bottom: 120px; /* 调整到更高位置，避免遮挡导航按钮 */
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    .knowledge-graph-modal-content {
        width: 95%;
        height: 90%;
        margin: 20px;
    }
    
    .knowledge-graph-modal-header {
        padding: 16px 20px;
    }
    
    .knowledge-graph-modal-header h2 {
        font-size: 1.25rem;
    }
}

/* Tooltip Styles */
.tooltip-trigger {
    position: relative; 
    cursor: help; 
    border-bottom: 1px dotted #60a5fa; 
    display: inline-block; 
}
.tooltip-trigger .tooltip-icon {
    display: inline-block; width: 16px; height: 16px;
    background-color: #60a5fa; color: white;
    border-radius: 50%; text-align: center;
    font-size: 12px; line-height: 16px; 
    margin-left: 4px; font-style: normal; 
    font-weight: bold; user-select: none; 
}
.tooltip-trigger .tooltip-text {
    visibility: hidden; width: 200px; 
    background-color: #2d3748; color: #fff; 
    text-align: left; border-radius: 6px;
    padding: 8px 12px; position: absolute;
    z-index: 10; bottom: 125%; 
    left: 50%; margin-left: -100px; 
    opacity: 0; transition: opacity 0.3s, visibility 0s linear 0.3s; 
    font-size: 0.875rem; line-height: 1.5;
}
.tooltip-trigger .tooltip-text::after {
    content: ""; position: absolute;
    top: 100%; left: 50%; margin-left: -5px;
    border-width: 5px; border-style: solid;
    border-color: #2d3748 transparent transparent transparent; 
}
.tooltip-trigger:hover .tooltip-text {
    visibility: visible; opacity: 1;
    transition-delay: 0s; 
}

/* Info Box Styles */
.info-box {
    padding: 1rem; margin-top: 1.5rem; margin-bottom: 1.5rem; 
    border-left-width: 4px; border-radius: 0.25rem; 
}
.info-box .info-box-title {
    font-weight: 600; margin-bottom: 0.5rem; 
    display: flex; align-items: center;
}
.info-box .info-box-icon { margin-right: 0.5rem; font-size: 1.25rem; }
.tip-box { background-color: #fefce8; border-color: #facc15; color: #854d0e; }
.tip-box .info-box-title { color: #a16207; }
.note-box { background-color: #eff6ff; border-color: #60a5fa; color: #1e40af; }
.note-box .info-box-title { color: #1d4ed8; }
.warning-box { background-color: #fef2f2; border-color: #f87171; color: #991b1b; }
.warning-box .info-box-title { color: #b91c1c; }

/* Drag and Drop Styles */
.draggable-item {
    transition: opacity 0.2s ease;
    border: 1px solid transparent; 
    user-select: none; 
    -webkit-user-select: none; 
    -moz-user-select: none; 
    -ms-user-select: none; 
    touch-action: none; 
}
.draggable-item.opacity-50 { 
    opacity: 0.5;
}
.drop-zone {
    transition: background-color 0.2s ease, border-color 0.2s ease;
}
.drop-zone.dragover-active { 
    background-color: #dbeafe !important; 
    border-color: #3b82f6 !important; 
}
.draggable-item.correct-drop {
    border: 2px solid #22c55e !important; 
    background-color: #dcfce7 !important; 
}
.draggable-item.wrong-drop {
    border: 2px solid #ef4444 !important; 
    background-color: #fee2e2 !important; 
}

/* Matching Exercise Styles */
#dynamic-content-wrapper .matching-item { 
    padding: 0.5rem; 
    border: 1px solid #e5e7eb; 
    border-radius: 0.375rem; 
    background-color: #f9fafb; 
    cursor: pointer;
    margin-bottom: 0.5rem; 
    transition: background-color 0.2s, border-color 0.2s;
    user-select: none; 
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}
#dynamic-content-wrapper .matching-item:hover {
    background-color: #f3f4f6; 
}
#dynamic-content-wrapper .matching-item.selected-match-item {
    background-color: #dbeafe; 
    border-color: #3b82f6; 
    font-weight: 600;
}
#dynamic-content-wrapper .matching-item.correct-match {
    background-color: #dcfce7 !important; 
    border-color: #22c55e !important; 
    color: #15803d; 
}
#dynamic-content-wrapper .matching-item.incorrect-match {
    background-color: #fee2e2 !important; 
    border-color: #ef4444 !important; 
    color: #b91c1c; 
}
#dynamic-content-wrapper .matching-item.paired { 
    opacity: 0.7;
    cursor: default;
}


/* Flashcard Styles */
#dynamic-content-wrapper .flashcard-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); 
    gap: 1rem;
}
#dynamic-content-wrapper .flashcard {
    aspect-ratio: 3 / 2; 
    border-radius: 0.5rem; 
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    position: relative; 
    perspective: 1000px; 
    transform-style: preserve-3d; 
    transition: transform 0.6s; 
    user-select: none; 
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}
#dynamic-content-wrapper .flashcard.is-flipped {
    transform: rotateY(180deg);
}
#dynamic-content-wrapper .flashcard-face { 
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden; 
    backface-visibility: hidden; 
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    border-radius: 0.5rem; 
    text-align: center;
    font-size: 1.125rem; 
    font-weight: 600; 
}
#dynamic-content-wrapper .flashcard-front {
    background-color: #6366f1; 
    color: white;
}
#dynamic-content-wrapper .flashcard-back {
    background-color: #a78bfa; 
    color: white;
    transform: rotateY(180deg); 
}

/* Mind Map Styles */
.mindmap-container { 
    background-color: #f0f9ff; 
    border: 1px solid #7dd3fc; 
    padding: 1.5rem; 
    border-radius: 0.5rem; 
    margin-top: 1.5rem; 
}
.mindmap-container h4 { 
    color: #0369a1; 
    font-size: 1.25rem; 
    font-weight: 600; 
    margin-bottom: 1rem; 
    text-align: center;
}
.mindmap { 
    list-style-type: none; 
    padding-left: 0; 
    text-align: center; 
}
.mindmap ul { 
    padding-left: 30px; 
    margin-top: 10px; 
    position: relative;
    display: flex; 
    flex-direction: column;
    align-items: center; 
}
.mindmap li { 
    margin: 10px 0; 
    display: inline-block; 
    text-align: left; 
    position: relative;
}
.mindmap li span {
    display: inline-block;
    padding: 8px 15px; 
    background-color: #e0f2fe; 
    border: 1px solid #38bdf8; 
    border-radius: 20px; 
    color: #075985; 
    font-size: 0.95em;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: transform 0.2s ease;
}
.mindmap li span:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.mindmap ul::before { 
    content: '';
    position: absolute;
    top: -10px; 
    left: 50%; 
    transform: translateX(-50%);
    width: 2px;
    height: 20px; 
    background-color: #7dd3fc; 
}
.mindmap li > ul > li::before { 
    content: '';
    position: absolute;
    top: 50%; 
    left: -15px; 
    transform: translateY(-50%);
    width: 15px; 
    height: 2px;
    background-color: #7dd3fc;
}
.mindmap li > ul > li:first-child:last-child::before { 
    left: -15px;
}


/* Key Points Box Styles */
.key-points-box {
    background-color: #f0fdf4; 
    border-color: #4ade80; 
    color: #15803d; 
}
.key-points-box .info-box-title {
    color: #166534; 
}
.key-points-box ul {
    list-style-type: '🔑'; 
    padding-left: 0.5rem; 
}
.key-points-box ul li {
    padding-left: 0.5rem; 
    color: #14532d; 
}

/* --- 新增：总结表格样式 (Summary Table) --- */
.summary-table-container {
    margin-top: 2rem; /* mt-8 */
    margin-bottom: 2rem; /* mb-8 */
    overflow-x: auto; /* Allow horizontal scrolling on small screens */
}
.summary-table {
    width: 100%;
    border-collapse: collapse; /* Remove space between borders */
    font-size: 0.9em; /* Slightly smaller font for table content */
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden; /* Ensures border-radius is applied to corners */
}
.summary-table th,
.summary-table td {
    border: 1px solid #e5e7eb; /* gray-200 */
    padding: 10px 12px; /* Adjusted padding */
    text-align: left;
    vertical-align: top; /* Align content to the top of the cell */
}
.summary-table th {
    background-color: #f3f4f6; /* gray-100 */
    color: #1f2937; /* gray-800 */
    font-weight: 600; /* semibold */
}
.summary-table td code { /* Style for code within table cells */
    background-color: #fef3c7; /* amber-100 */
    color: #b45309; /* amber-700 */
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 0.95em;
}
.summary-table tr:nth-child(even) {
    background-color: #f9fafb; /* gray-50 for even rows */
}
.summary-table tr:hover {
    background-color: #eff6ff; /* blue-50 on hover */
}
.summary-table .category-header { /* For "感知特征", "常规用法" etc. */
    background-color: #e0e7ff; /* indigo-100 */
    color: #3730a3; /* indigo-800 */
    font-weight: bold;
    text-align: center;
}
.summary-table .noun-type-header { /* For "典型物体", "典型物质", "模糊区域" */
    background-color: #dbeafe; /* blue-100 */
    font-weight: bold;
}


/* Responsive adjustments (ensure these are at the end) */
@media (max-width: 768px) {
    .app-container { padding-top: 56px; }
    .sidebar { width: 250px; top: 56px; height: calc(100vh - 56px); }
    .main-content-area { margin-left: 0; }
    .main-content-area.sidebar-collapsed { margin-left: 0; }
    .sidebar:not(.collapsed) { box-shadow: 2px 0 5px rgba(0,0,0,0.1); }
    header { height: 56px; }
    header h1 { font-size: 1.25rem; margin-left: 50px; }
    .sidebar-toggle-container { top: 8px; left: 10px; }
    #sidebar-toggle { font-size: 20px; }
    #dynamic-content-wrapper.content-block { padding: 20px; }
    #dynamic-content-wrapper h2 { font-size: 1.5rem; }
    #dynamic-content-wrapper h3 { font-size: 1.25rem; }
    #dynamic-content-wrapper .content-navigation { flex-direction: column; gap: 10px; }
    #dynamic-content-wrapper .nav-button { width: 100%; text-align: center; }
    #dynamic-content-wrapper .flashcard-container { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
    .mindmap ul { padding-left: 15px; } 
    .mindmap li > ul > li::before { left: -10px; width: 10px; }
    .summary-table th, .summary-table td { padding: 8px; font-size: 0.85em;} /* Adjust table for smaller screens */
}

/* 时间轴基础样式 - 适用于所有设备 */
/* 教科书式专注框样式 */
.focus-box {
  border: 2px solid #3b82f6;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  background-color: #f0f9ff;
  overflow: hidden;
  position: relative;
}

.focus-box-header {
  background-color: #3b82f6;
  color: white;
  padding: 10px 15px;
  display: flex;
  align-items: center;
}

.focus-box-icon {
  font-size: 1.25rem;
  margin-right: 10px;
}

.focus-box-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
}

.focus-box-content {
  padding: 15px;
}

/* 对应时间轴的基础样式保持不变 */
.timeline-container {
  position: relative;
  margin: 30px auto;
  width: 90%;
  max-width: 600px;
}

.timeline {
  height: 10px;
  position: relative;
  background: #e5e7eb;
  border-radius: 5px;
  overflow: visible;
}

.timeline-failed {
  position: absolute;
  width: 50%;
  height: 100%;
  left: 0;
  background-color: #fee2e2;
  border-radius: 5px 0 0 5px;
}

.timeline-succeeded {
  position: absolute;
  width: 50%;
  height: 100%;
  right: 0;
  background-color: #dcfce7;
  border-radius: 0 5px 5px 0;
}

.timeline-separator {
  position: absolute;
  width: 4px;
  height: 20px;
  background-color: #6b7280;
  left: 50%;
  top: -5px;
  transform: translateX(-50%);
}

.timeline-indicator {
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background-color: #3b82f6;
  top: -5px;
  left: 30%;
  transform: translateX(-50%);
  transition: left 0.8s ease-in-out;
  z-index: 10;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

.timeline-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 0.9rem;
}

.label-failed {
  color: #b91c1c;
}

.label-succeeded {
  color: #15803d;
  text-align: right;
}

.adverb-buttons {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin: 15px 0;
}

.adverb-button {
  padding: 8px 16px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.adverb-button:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.5);
}

.adverb-explanation {
  text-align: center;
  margin: 15px 0;
  min-height: 24px;
}

.adverb-examples {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 15px;
}

.adverb-example {
  padding: 15px;
  border: 1px solid #e5e7eb;
  border-radius: 5px;
  background-color: white;
}

/* 触摸设备优化样式 */
@media (max-width: 768px) {
  /* 响应式布局调整 */
  .adverb-examples {
    grid-template-columns: 1fr; /* 在小屏幕上堆叠显示示例 */
  }
  
  .adverb-buttons {
    flex-direction: column; /* 在小屏幕上垂直排列按钮 */
    align-items: center;
    gap: 10px;
  }
  
  .timeline-container {
    width: 100%; /* 在小屏幕上占满宽度 */
  }
  
  /* 触摸友好的尺寸 */
  .adverb-button {
    padding: 10px 16px; /* 增加按钮尺寸 */
    min-width: 120px; /* 确保按钮足够大 */
    min-height: 44px; /* 触摸目标至少44x44像素 */
    width: 80%; /* 在移动设备上增加宽度 */
  }
  
  .timeline-indicator {
    width: 24px; /* 增大指示器大小 */
    height: 24px; /* 增大指示器大小 */
    top: -7px; /* 调整位置以保持居中 */
  }
  
  /* 移动设备触摸体验优化 */
  .timeline-indicator {
    transition: left 0.5s ease-in-out; /* 较短的过渡时间 */
  }
  
  .adverb-button:active {
    transform: scale(0.95); /* 点击时的视觉反馈 */
    background-color: #1e40af !important; /* 点击时的颜色变化 */
  }
}

/* 触摸设备专用优化，不依赖屏幕尺寸 */
.touch-device .adverb-button {
  touch-action: manipulation; /* 防止浏览器默认行为干扰 */
  -webkit-tap-highlight-color: rgba(0,0,0,0); /* 去除iOS上的点击高亮 */
}

.touch-device .timeline-indicator {
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.7); /* 增强阴影效果，提高可见性 */
}

@media (max-width: 768px) {
  .focus-box {
    margin-left: -5px;
    margin-right: -5px;
    border-radius: 6px;
  }
  
  .focus-box-header {
    padding: 8px 12px;
  }
  
  .focus-box-title {
    font-size: 1rem;
  }
  
  .focus-box-content {
    padding: 12px;
  }
}

