
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Sans SC", "Microsoft YaHei", "SimSun"; /* Added Chinese fonts */
margin: 0; display: flex; flex-direction: column;
min-height: 100vh; background-color: #f0f4f8; color: #333;
}
.page-header {
background-color: #ffffff; padding: 15px 30px; text-align: center;
box-shadow: 0 2px 4px rgba(0,0,0,0.05); border-bottom: 2px solid #c00000; /* Red for Chinese theme */ flex-shrink: 0;
}
.page-header h1 {
margin: 0; font-size: 3em; /* Larger for single character */ color: #b22222; /* Darker Red */
display: flex; align-items: center; justify-content: center;
}
.speak-button {
background: none; border: none; font-size: 0.8em; /* Adjusted */
padding: 0 0 0 10px; cursor: pointer; color: #c00000; line-height: 1;
}
.speak-button:hover { color: #800000; }
.speak-button-inline {
background: none; border: none; font-size: 0.9em; /* Adjusted */
padding: 0 0 0 5px; cursor: pointer; color: #c00000;
}
.content-container {
flex-grow: 1; width: 100%; max-width: 1400px;
margin: 20px auto; padding: 0 20px; box-sizing: border-box;
}
.top-content-area {
display: flex; flex-direction: row; gap: 25px;
background-color: #ffffff; padding: 25px; border-radius: 8px;
box-shadow: 0 3px 10px rgba(0,0,0,0.07); margin-bottom: 25px;
}
.text-details-area { flex: 1 1 60%; min-width: 300px; }
.image-area {
flex: 1 1 40%; min-width: 250px;
display: flex; flex-direction: column;
align-items: center; justify-content: flex-start; padding-top: 10px;
}
.section-title { /* Kept for compatibility if reused, but new titles are more specific */
color: #b22222; font-weight: 600; font-size: 1.2em;
margin-top: 20px; margin-bottom: 8px;
border-bottom: 1px solid #f0d0d0; padding-bottom: 5px;
}
.section-title-major { /* For main section titles */
    font-size: 1.8em; color: #a52a2a; margin-top: 30px; margin-bottom: 15px;
    text-align: center; border-bottom: 2px solid #e6b3b3; padding-bottom: 10px;
}
.text-details-area ul { padding-left: 20px; list-style-type: disc; }
.text-details-area ul li { margin-bottom: 6px; line-height: 1.7;}
.text-details-area p { line-height: 1.6; margin-bottom: 10px;}
.example-sentence-block { margin-bottom: 15px; padding-left:15px; border-left: 3px solid #f0d0d0;}
.example-sentence-zh { font-size: 1.1em; color: #333; }
.example-sentence-pinyin { font-style: italic; color: #555; font-size:0.95em; }
.example-sentence-en { color: #777; font-size: 0.9em; }

.word-image { /* Renamed class to .character-image if specific needed, but .word-image is fine */
max-width: 100%; max-height: 350px; height: auto;
margin-bottom: 20px; border: 1px solid #e1e4e8;
padding: 8px; border-radius: 8px;
background-color: #f9f9f9; object-fit: contain; display: block;
}
.placeholder-image {
width: 100%; max-width: 300px; min-height: 220px;
background-color: #f0f0f0; border: 1px dashed #ccc;
display: flex; align-items: center; justify-content: center;
text-align: center; border-radius: 8px; margin: 20px auto;
}
.placeholder-image-text { color: #777; font-style: italic; }
.additional-info-area {
margin-top: 30px; padding: 25px; background-color: #ffffff;
border-radius: 8px; box-shadow: 0 3px 10px rgba(0,0,0,0.07);
}
/* .additional-info-area > h2: first-of-type for major section title */
.info-block {
background-color: #fff8f8; padding: 15px 20px; margin-bottom: 20px;
border-radius: 6px; border: 1px solid #f8e8e8;
box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.info-block:last-child { margin-bottom: 0; }
.info-block-title {
font-size: 1.25em; color: #c00000; margin-top: 0; margin-bottom: 12px;
padding-bottom: 8px; border-bottom: 1px dotted #f8cccc;
}
.info-block p, .info-block ul, .info-block div { line-height: 1.7; margin-bottom: 0; }
.info-block ul { list-style-type: circle; padding-left: 25px; margin-top: 5px; }
.info-block ul li { margin-bottom: 8px; }
.info-block ul li strong { color: #333; }
.bilingual-p { margin-bottom: 10px; }
.bilingual-p .lang-zh { display: block; margin-bottom: 4px; font-size: 1.05em; color: #333; }
.bilingual-p .lang-en { display: block; font-size: 0.95em; color: #666; font-style: italic;}

.era-writing-item { margin-bottom:10px; padding-bottom:10px; border-bottom:1px dashed #eee; }
.era-writing-item:last-child { border-bottom:none; }
.era-writing-item strong { color: #8B0000; }

.idiom-story-item { margin-bottom: 15px; }
.idiom-title { font-size: 1.15em; font-weight: bold; color: #800000; }
.idiom-pinyin { font-style: italic; color: #444; margin-left: 10px; }
.idiom-meaning-en { font-size: 0.9em; color: #555; margin-left: 10px; display:block; margin-bottom:5px; }

.translation-item { margin-bottom: 5px; }
.translation-item strong { color: #700; }

.video-links-container ul { list-style: disclosure-closed; padding-left: 20px; }
.video-links-container ul li a { color: #c00000; text-decoration:none; }
.video-links-container ul li a:hover { text-decoration:underline; }

.google-result-item { margin-bottom: 15px; padding-bottom: 10px; border-bottom: 1px dotted #ddd; }
.google-result-item:last-child { border-bottom: none; margin-bottom: 0; }
.google-result-item h4 { margin: 0 0 5px 0; font-size: 1.1em; }
.google-result-item h4 a { text-decoration: none; color: #c00000; }
.google-result-item h4 a:hover { text-decoration: underline; }
.google-result-item .snippet { font-size: 0.9em; color: #555; margin-bottom: 5px; }
.google-result-item .scraped-summary p { font-size: 0.95em; margin-top: 8px; background-color: #fff5f5; padding: 8px; border-radius: 4px;}

.additional-images-gallery {
display: flex; flex-wrap: wrap; gap: 15px; justify-content: center; margin-top: 10px;
}
.additional-image-item img {
max-width: 250px; max-height: 250px; height: auto;
border: 1px solid #ddd; border-radius: 6px; padding: 5px; background-color: #fff;
object-fit: cover;
}

.bottom-navigation {
background-color: #ffffff; padding: 20px; border-top: 1px solid #d1d5da;
box-shadow: 0 -2px 5px rgba(0,0,0,0.05); flex-shrink: 0; text-align: center;
}
.bottom-navigation h3 { color: #c00000; margin-top: 0; font-size: 1.3em; margin-bottom: 15px; }
.bottom-navigation #bottomSearchInput {
width: calc(80% - 22px); max-width: 400px; padding: 10px; margin: 0 auto 15px auto;
border: 1px solid #d1d5da; border-radius: 6px; box-sizing: border-box; display: block;
}
.bottom-navigation ul {
list-style-type: none; padding: 0; max-height: 200px; overflow-y: auto;
margin-bottom: 15px; border: 1px solid #eee; border-radius: 4px;
display: inline-block; text-align: left; padding: 10px;
}
.bottom-navigation li a {
text-decoration: none; color: #c00000; display: block;
padding: 6px 10px; border-radius: 4px;
transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
}
.bottom-navigation li a:hover, .bottom-navigation li a.active { background-color: #fff0f0; color: #a00000; }
.nav-home-link-bottom {
display: inline-block; margin-top: 10px; padding: 10px 15px;
background-color: #d9534f; color: white !important; /* Bootstrap danger-like red */
text-decoration: none; border-radius: 5px;
}
.nav-home-link-bottom:hover { background-color: #c9302c; }
.page-footer {
text-align: center; padding: 15px; background-color: #e9ecef;
border-top: 1px solid #ced4da; color: #6c757d;
width: 100%; box-sizing: border-box; flex-shrink: 0; font-size: 0.9em;
}
.page-footer a { color: #c00000; text-decoration: none; }
.page-footer a:hover { text-decoration: underline; }
.index-header {
background-color: #c00000; color: white; padding: 30px 20px;
text-align: center; margin-bottom: 30px; flex-shrink: 0;
}
.index-header h1 { font-size: 2.8em; margin-bottom: 5px; color: white; }
.index-header p { font-size: 1.2em; opacity: 0.9; }
.character-groups .group-card { /* Modified class from .word-groups */
background-color: #ffffff; border: 1px solid #d1d5da; border-radius: 8px;
padding: 20px; width: calc(33.333% - 30px); min-width: 280px; /* Adjust as needed for Hanzi */
box-shadow: 0 4px 12px rgba(0,0,0,0.08);
transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}
.character-groups .group-card:hover { transform: translateY(-5px); box-shadow: 0 6px 16px rgba(0,0,0,0.12); }
.character-groups .group-card h2 {
margin-top: 0; color: #c00000; border-bottom: 1px solid #eaecef;
padding-bottom: 10px; font-size: 1.5em;
}
.character-groups .group-card ul { list-style-type: none; padding: 0; max-height: 250px; overflow-y: auto; }
.character-groups .group-card li { margin-bottom: 8px; }
.character-groups .group-card li a { text-decoration: none; color: #333; font-weight: 500; font-size: 1.1em; /* Larger for Hanzi */ }
.character-groups .group-card li a:hover { color: #c00000; text-decoration: underline; }
/* Responsiveness */
@media (max-width: 992px) {
.top-content-area { flex-direction: column; }
.text-details-area { margin-bottom: 20px; } .image-area { padding-top: 0; }
}
@media (max-width: 768px) {
.page-header h1 { font-size: 2.5em; }
.content-container { padding: 0 15px; margin: 15px auto; }
.top-content-area, .additional-info-area { padding: 20px; }
.bottom-navigation #bottomSearchInput { width: calc(90% - 22px); }
.bottom-navigation ul { padding: 5px; max-height: 150px; }
.section-title-major { font-size: 1.6em; } .info-block-title { font-size: 1.15em; }
}
@media (max-width: 600px) {
.character-groups .group-card { width: calc(100% - 20px); } /* Full width for small screens */
.page-header h1 { font-size: 2em; }
.text-details-area, .image-area, .bottom-navigation, .additional-info-area { padding: 15px; }
.section-title-major { font-size: 1.4em; } .info-block-title { font-size: 1.1em; }
.additional-images-gallery { justify-content: center; }
.additional-image-item img { max-width: 100%; }
}
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 10px; }
::-webkit-scrollbar-thumb { background: #c1c1c1; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #a1a1a1; }
