:root {
    --color-primary: #007bff;     
    --color-success: #28a745;     
    --color-danger: #dc3545;      
    --color-info: #17a2b8;        
    --color-warning: #ffc107;     
    --color-secondary: #6c757d;   
    --color-light-gray: #f9f9f9;
    --color-medium-gray: #e0e0e0;
    --color-dark-gray: #333;
    --color-specific-gray: #aaa; 
}

body {
    font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
    text-align: center;
    padding: 10px;
}

h1 {
    margin-top: 10px;
}

#test-display-area {
    width: 95%; 
    margin: 10px auto;
    padding: 10px;
    text-align: center;
}

#chart-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 10px auto;
    margin-top: 30px;
    padding: 5px;
    max-width: 100%;
}

.chart-line {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin: 8px 0;
    opacity: 1.0; 
    padding: 3px 0;
}


#chart-info {
    max-width: 90%; 
    margin: 10px auto;
    padding: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    background-color: #f9f9f9;
}

#chart-info p {
    margin: 5px 0;
    text-align: left;
}

.contrast-label {
    display: inline-block;
    width: 4.5em; 
    text-align: right; 
    letter-spacing: 0.5em; 
    margin-right: -0.5em; /* 抵消最后一个字符的多余间距 */
}


#chart-info p strong {
    color: #333;
    text-align: left;
}

.optotype-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.optotype {
    transform-origin: center center;
    transition: transform 0.1s, opacity 0.3s;
}

.optotype img {
    height: 100%;
    width: 100%;
    display: block;
}

#controls, #calibration-section {
    max-width: 600px; 
    width: 95%;
    margin: 10px auto;
    padding: 15px;
    border: 1px solid #ccc;
    border-radius: 8px;
    text-align: left;
}

#calibration-section {
    text-align: left;
}

.ruler-bar {
    width: 200px; 
    height: 10px; 
    background-color: #aaa; 
    margin: 10px auto;
}

.warning-text {
    color: red;
    font-weight: bold;
    margin-top: 10px;
}

.h-spacer {
    margin-top: 20px; 
    margin-bottom: 0px; 
}


fieldset {
    border: 1px solid #eee;
    padding: 10px;
    margin-bottom: 10px;
}

.setting-legend {
    margin-bottom: 5px;
}

label {
    display: block;
    margin-bottom: 5px;
}

input[type="number"], select {
    padding: 5px;
    margin-right: 15px;
    width: 60%;
    max-width: 150px; 
}

button {
    padding: 10px 15px;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 10px;
    transition: background-color 0.2s;
    margin-right: 5px;
}

.button-group {
    text-align: center;
    margin-top: 10px;
}

.top-controls {
    margin-bottom: 20px;
}

.test-controls-group {
    margin-top: 20px;
}


.btn-primary { background-color: var(--color-primary); }
.btn-primary:hover { background-color: #0056b3; }

.btn-success { background-color: var(--color-success); }
.btn-success:hover { background-color: #1e7e34; }

.btn-danger { background-color: var(--color-danger); }
.btn-danger:hover { background-color: #bd2130; }

.btn-info { background-color: var(--color-info); }
.btn-info:hover { background-color: #117a8b; }

.btn-warning { background-color: var(--color-warning); color: var(--color-dark-gray); }
.btn-warning:hover { background-color: #d8a200; }

.btn-secondary { background-color: var(--color-secondary); }
.btn-secondary:hover { background-color: #5a6268; }

.btn-gray-light { background-color: var(--color-specific-gray); }
.btn-gray-light:hover { background-color: #888; }

#test-type-selection button {
    padding: 12px 20px;
    font-weight: bold;
}

#test-controls button {
    padding: 10px 15px;
    font-weight: bold;
}

#full-chart-display-area {
    flex-direction: column;
    width: 98%;
    margin: 0 auto;
    margin-top: -20px;
    padding: 10px 0;
    min-height: calc(100vh - 120px); 
    height: auto;
    text-align: center;
}

#full-chart-wrapper {
    flex-grow: 1; 
    overflow-y: auto; 
    max-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center; 
    margin: 10px auto; 
    padding: 20px 0 50px 0; 
    width: 100%;
    box-sizing: border-box; 
}

.full-chart-row {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%; 
    margin: 0;
    padding: 0 5px; 
    box-sizing: border-box; 
    position: relative;
    cursor: pointer;
    transition: background-color 0.1s;
}

.highlighted-row {
    background-color: rgba(0, 123, 255, 0.1);
    border-radius: 5px;
}

.chart-label {
    min-width: 120px; 
    text-align: left;
    font-size: 1.0em;
    color: #333;
    padding-right: 10px; 
    font-weight: normal;
    flex-shrink: 0; 
    white-space: normal; 
    line-height: 1.2;
    cursor: default;
}

.chart-label-text-hidden {
    color: transparent !important; 
    visibility: hidden; 
}

.full-chart-line {
    flex-grow: 1; 
    justify-content: center; 
    align-items: center;
    margin: 0; 
    padding: 0;
    min-width: 0; 
    overflow-x: hidden; 
}

.full-chart-line .optotype-container {
    margin-right: 5px; 
}

#label-tooltip {
    position: fixed; 
    background-color: var(--color-dark-gray);
    color: white;
    padding: 8px 12px; 
    border-radius: 5px;
    font-size: 0.9em;
    z-index: 10000; 
    pointer-events: auto; 
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.2s; 
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

#label-tooltip.active {
    opacity: 1;
}

#label-tooltip::before {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: var(--color-dark-gray) transparent transparent transparent;
}

@media (max-width: 600px) {
    .full-chart-row {
        justify-content: space-between; 
        flex-wrap: nowrap; 
        padding: 0; 
    }

    .chart-label {
        text-align: left; 
        min-width: 80px;
        font-size: 0.9em;
        padding-right: 15px; 
    }
}

.full-chart-remark {
    margin-top: 0px; 
    margin-bottom: 15px; 
    text-align: center; 
    color: #000000ff;
}