
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
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 #007bff; flex-shrink: 0;
}
.page-header h1 {
margin: 0; font-size: 2.2em; color: #FF8C00;
display: flex; align-items: center; justify-content: center;
}
.speak-button {
background: none; border: none; font-size: 1.2em;
padding: 0 0 0 10px; cursor: pointer; color: #007bff; line-height: 1;
}
.speak-button:hover { color: #0056b3; }
.speak-button-inline {
background: none; border: none; font-size: 1em;
padding: 0 0 0 5px; cursor: pointer; color: #007bff;
}
.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 {
color: #0366d6; font-weight: 600; font-size: 1.2em;
margin-top: 20px; margin-bottom: 8px;
border-bottom: 1px solid #eaecef; padding-bottom: 5px;
}
.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 { font-style: italic; color: #24292e; }
.example-translation { color: #586069; font-size: 0.95em; margin-left: 15px; display: block; margin-bottom: 10px;}
.word-image {
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 {
font-size: 1.8em; color: #0056b3; margin-top: 0; margin-bottom: 25px;
text-align: center; border-bottom: 1px solid #e1e4e8; padding-bottom: 15px;
}
.info-block {
background-color: #fdfdff; padding: 15px 20px; margin-bottom: 20px;
border-radius: 6px; border: 1px solid #eef2f7;
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: #007bff; margin-top: 0; margin-bottom: 12px;
padding-bottom: 8px; border-bottom: 1px dotted #cce5ff;
}
.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; }
.movie-quote-item {
margin-bottom: 18px; padding-bottom: 12px; border-bottom: 1px dashed #eee;
}
.movie-quote-item:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.movie-quote-item .quote-text { font-style: italic; color: #24292e; margin-bottom: 4px; font-size: 1.05em; }
.movie-quote-item .quote-translation { font-size: 0.9em; color: #586069; margin-left: 15px; display: block; margin-bottom: 5px; }
.movie-quote-item .movie-source-text { font-size: 0.85em; color: #777; text-align: right; display: block; margin-top: 3px; }
.info-block .extended-info-text p { margin-bottom: 10px; text-indent: 2em; }
.info-block .extended-info-text p:last-child { margin-bottom: 0; }
.letter-explanation-item {
margin-bottom: 8px;
padding-left: 10px;
border-left: 3px solid #007bffaa;
}
.letter-explanation-item strong {
font-size: 1.1em;
color: #0056b3;
margin-right: 8px;
display: inline-block; /* Allows for margin /
min-width: 20px; / Ensures some space for the letter */
text-align: center;
}

/* NEW CSS for V4 (includes custom-letter-root-block) */
.custom-letter-root-block ul { list-style-type: square; padding-left: 20px;}
.custom-letter-root-block ul li { margin-bottom: 5px; }
.custom-letter-root-block h4 { /* Style for subheadings within the block */
    font-size: 1.1em; /* Slightly smaller than info-block-title */
    color: #0056b3; /* Consistent color */
    margin-top: 15px;
    margin-bottom: 8px;
    padding-bottom: 5px;
    border-bottom: 1px dotted #ddd; /* Lighter border */
}
.custom-letter-root-block h4:first-child {
    margin-top: 5px; /* Less top margin for the very first h4 */
    border-top: none; /* No top border for the first one */
}


.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: #0056b3; }
.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: #f9f9f9; padding: 8px; border-radius: 4px;}

.video-section-container { display: flex; flex-wrap: wrap; gap: 20px; justify-content: space-around; }
.video-card {
flex: 1 1 300px; /* Grow and shrink, base width 300px /
max-width: 45%; / Limit max width for larger screens /
border: 1px solid #eee; border-radius: 6px; padding: 10px;
background-color: #fcfcfc; text-align: center;
}
.video-card h4 { margin-top: 0; font-size: 1.1em; color: #333; }
.video-card iframe {
width: 100%;
max-width: 480px; /* Standard video width /
height: 270px; / 16:9 aspect ratio */
border: none; border-radius: 4px; margin-bottom: 10px;
}
.video-card .youtube-watch-link { display: block; margin-top:10px; font-size:0.9em; } /* Changed from bilibili-search-link */

.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;
}
/* END NEW CSS for V4 */

.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: #0366d6; 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: #0366d6; 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: #f0f4f8; color: #005cc5; }
.nav-home-link-bottom {
display: inline-block; margin-top: 10px; padding: 10px 15px;
background-color: #28a745; color: white !important;
text-decoration: none; border-radius: 5px;
}
.nav-home-link-bottom:hover { background-color: #218838; }
.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: #007bff; text-decoration: none; }
.page-footer a:hover { text-decoration: underline; }
.index-header {
background-color: #0366d6; 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; }
.word-groups {
display: flex; flex-wrap: wrap; gap: 25px; justify-content: center;
padding: 0 20px 20px 20px; max-width: 1200px; margin: 0 auto; flex-grow: 1;
}
.group-card {
background-color: #ffffff; border: 1px solid #d1d5da; border-radius: 8px;
padding: 20px; width: calc(33.333% - 30px); min-width: 280px;
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;
}
.group-card:hover { transform: translateY(-5px); box-shadow: 0 6px 16px rgba(0,0,0,0.12); }
.group-card h2 {
margin-top: 0; color: #0366d6; border-bottom: 1px solid #eaecef;
padding-bottom: 10px; font-size: 1.5em;
}
.group-card ul { list-style-type: none; padding: 0; max-height: 250px; overflow-y: auto; }
.group-card li { margin-bottom: 8px; }
.group-card li a { text-decoration: none; color: #24292e; font-weight: 500; }
.group-card li a:hover { color: #0366d6; text-decoration: underline; }
@media (max-width: 992px) {
.top-content-area { flex-direction: column; }
.text-details-area { margin-bottom: 20px; } .image-area { padding-top: 0; }
.video-card { max-width: 100%; }
}
@media (max-width: 768px) {
.page-header h1 { font-size: 1.8em; }
.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; }
.additional-info-area > h2 { font-size: 1.6em; } .info-block-title { font-size: 1.15em; }
}
@media (max-width: 600px) {
.group-card { width: calc(100% - 20px); }
.page-header h1 { font-size: 1.6em; } .section-title {font-size: 1.1em;}
.text-details-area, .image-area, .bottom-navigation, .additional-info-area { padding: 15px; }
.additional-info-area > h2 { 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; }
