:root {
    /* --- Color Palette (Slightly adjusted for contrast) --- */
    --bg-color: #fdfdfa;              /* Background - Keep soft */
    --container-bg: #ffffff;         /* Main content area bg */
    --text-color: #3f3f3f;           /* Main text - Slightly darker for better contrast */
    --text-secondary: #888888;       /* Secondary text - Slightly darker */
    --accent-yellow: #ffeaa7;          /* Soft goose yellow */
    --accent-yellow-darker: #f7d794; /* Slightly darker yellow for borders/hover */
    --border-color: #e Padded hint/feedback areaeaea;         /* Very light border */
    --hover-bg: #fffefa;              /* Very subtle hover */

    /* Feedback Colors (Keep soft but distinct) */
    --correct-bg: #e8f5e9;
    --correct-border: #c8e6c9;
    --correct-text: #2e7d32;         /* Darker green text for better contrast */
    --incorrect-bg: #ffebee;
    --incorrect-border: #ffcdd2;
    --incorrect-text: #b71c1c;         /* Darker red text for better contrast */

    /* Hint & Highlight Colors */
    --hint-bg: #fff9e0;              /* Slightly creamier hint bg */
    --hint-border: var(--accent-yellow-darker);
    --question-highlight-bg: rgba(255, 234, 167, 0.7); /* Slightly more opaque */
    --question-highlight-border: var(--accent-yellow-darker); /* Solid border */

    /* --- Typography --- */
    --base-font-size: 16px;           /* Base size for relative units */
    --line-height-base: 1.75;         /* Slightly more generous line height */
    --line-height-compact: 1.6;      /* For lists etc. */
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "PingFang TC", "Microsoft YaHei"; /* Modern system font stack */
    line-height: var(--line-height-base);
    margin: 0;
    padding: 20px;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-size: var(--base-font-size); /* Set base font size */
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased; /* Smoother fonts on WebKit */
    -moz-osx-font-smoothing: grayscale; /* Smoother fonts on Firefox */
}

#quiz-wrapper {
    background: var(--container-bg);
    padding: 35px 40px; /* Slightly more padding */
    border-radius: 8px; /* Slightly larger radius */
    box-shadow: 0 2px 8px rgba(0,0,0,0.08); /* Slightly more defined shadow */
    max-width: 1000px; /* Allow slightly wider */
    width: 100%;
    border: 1px solid var(--border-color);
    box-sizing: border-box;
}

#score-area {
    text-align: right;
    margin-bottom: 25px; /* More space below score */
    color: var(--text-secondary);
    font-size: 0.9em; /* Relative to body */
}

#main-content {
    display: flex;
    gap: 40px; /* Increased gap */
}

#left-column {
    flex: 6; /* Adjust ratio slightly if needed */
    display: flex;
    flex-direction: column;
}

#right-column {
    flex: 4; /* Adjust ratio slightly */
    position: sticky;
    top: 25px; /* More space from top */
    height: fit-content;
    max-height: calc(100vh - 70px); /* Adjust offset */
    overflow-y: auto;
    padding-right: 12px;
    padding-left: 5px; /* Add slight left padding */
}
 /* Slightly softer scrollbar */
#right-column::-webkit-scrollbar {
    width: 8px;
}
#right-column::-webkit-scrollbar-track {
    background: #f0f0f0; /* Light track */
    border-radius: 4px;
}
#right-column::-webkit-scrollbar-thumb {
    background-color: #d1d1d1; /* Lighter thumb */
    border-radius: 4px;
    border: 2px solid #f0f0f0; /* Creates padding effect */
}
#right-column::-webkit-scrollbar-thumb:hover {
    background-color: #b1b1b1;
}


#question-area {
    margin-bottom: 30px; /* More space below question block */
}
#question-number {
     font-size: 0.85em;
     color: var(--text-secondary);
     margin-bottom: 10px;
}
#question-text {
    font-size: 1.2em; /* Slightly larger question text */
    margin-bottom: 30px;
    font-weight: 500; /* Medium weight for prominence */
    line-height: 1.8; /* More line height for readability */
}

#image-container {
     margin-bottom: 25px;
     text-align: center;
}
#question-image {
    max-width: 70%;
    height: auto;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}
 #q0_image {
     max-width: 30%;
}


.option {
    display: block;
    margin-bottom: 12px; /* Slightly more space between options */
    background-color: var(--container-bg);
    padding: 14px 20px; /* More padding inside options */
    border: 1px solid var(--border-color);
    border-radius: 6px; /* Match container radius */
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.option:hover {
    background-color: var(--hover-bg);
    border-color: var(--accent-yellow-darker);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05); /* Subtle shadow on hover */
}
.option input[type="radio"] {
    margin-right: 14px; /* More space after radio */
    vertical-align: middle;
    accent-color: var(--text-color);
}
.option label {
   vertical-align: middle;
   cursor: pointer;
   font-size: 1.2em; /* Slightly larger option text */
}


button {
    background-color: var(--container-bg);
    color: var(--text-color);
    border: 1px solid var(--accent-yellow-darker);
    padding: 10px 20px; /* Slightly larger buttons */
    border-radius: 6px;
    cursor: pointer;
    font-size: 1em; /* Base size */
    font-weight: 500; /* Medium weight button text */
    margin: 8px 6px 0 0;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.1s ease;
}
button:hover {
    background-color: var(--accent-yellow);
    border-color: var(--accent-yellow-darker);
    transform: translateY(-1px); /* Subtle lift */
}
button:disabled {
    background-color: #f5f5f5;
    color: var(--text-secondary);
    border-color: var(--border-color);
    cursor: not-allowed;
    transform: none;
}
#navigation-buttons {
    margin-top: 30px; /* More space above buttons */
    text-align: left;
}


/* --- Right Column Content Styling --- */
#detailed-hint-area, #feedback-area {
    padding: 20px 25px; /* More internal padding */
    margin-bottom: 25px;
    border-radius: 6px;
    border: 1px solid transparent;
    font-size: 0.95em; /* Slightly larger hint/feedback text */
    display: none;
}


#detailed-hint-area {
    background-color: var(--hint-bg);
    border-color: var(--hint-border);
    color: var(--text-color);
    line-height: var(--line-height-compact); /* Compact line height for lists */
}
#detailed-hint-area h5 {
    margin-top: 15px; /* More space above titles */
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--text-color);
    border-bottom: 1px solid var(--accent-yellow-darker); /* Underline title */
    padding-bottom: 5px;
}
 #detailed-hint-area h5:first-child {
    margin-top: 0;
 }
 #detailed-hint-area ul {
    list-style: none;
    padding-left: 5px;
    margin-top: 10px;
    margin-bottom: 15px;
 }
  #detailed-hint-area li {
    margin-bottom: 8px; /* More space between list items */
  }
 #detailed-hint-area .keyword-term {
    font-weight: 600;
    display: inline-block;
    min-width: 80px;
    margin-right: 5px; /* Space after term */
 }
 #detailed-hint-area .option-letter {
     font-weight: 600;
     display: inline-block;
     width: 25px;
 }


#feedback-area {
    border-width: 1px;
    border-style: solid;
    line-height: var(--line-height-base); /* More space in explanation */
}
#feedback-area.correct {
    background-color: var(--correct-bg);
    border-color: var(--correct-border);
    color: var(--correct-text);
    display: block;
}
#feedback-area.incorrect {
    background-color: var(--incorrect-bg);
    border-color: var(--incorrect-border);
    color: var(--incorrect-text);
    display: block;
}
#feedback-area h4 {
     margin-top: 0;
     margin-bottom: 12px;
     font-weight: 600;
     font-size: 1.1em; /* Slightly larger feedback title */
}
#feedback-area .explanation-title {
    font-weight: 600;
    color: inherit;
    display: inline-block;
    margin-right: 8px;
}
#feedback-area .explanation-content {
    display: inline;
}


 /* --- Results Screen Styling --- */
#results-area {
    background: var(--container-bg);
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    max-width: 550px;
    margin: 50px auto;
    text-align: center;
    display: none;
    border: 1px solid var(--border-color);
}
 #results-area h2 {
     color: var(--text-color);
     margin-bottom: 20px;
     font-weight: 500;
     font-size: 1.4em;
 }
 #results-area p {
    font-size: 1.15em;
    margin-bottom: 35px;
    line-height: var(--line-height-base);
 }
 #results-area button {
      font-size: 1.05em;
      padding: 12px 24px;
 }

 /* --- Highlighting Styles --- */
.highlight-question {
    background-color: var(--question-highlight-bg);
    padding: 0.1em 0.4em; /* Slightly more horizontal padding */
    border-radius: 4px;
    /* border: 1px dashed var(--question-highlight-border); */ /* Dashed felt a bit busy */
    border: 1px solid var(--question-highlight-border); /* Changed to solid */
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
    margin: 0 1px; /* Prevent highlights sticking together */
}
.highlight-keyword { /* For keywords in explanation */
     background-color: var(--accent-yellow);
     padding: 2px 4px;
     border-radius: 3px;
     font-weight: 500; /* Slightly bolder */
}