body {
    font-family: Arial, sans-serif;
    margin: 20px;
}

/* 数据管理面板样式 */
.data-management-panel {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.current-record-info, .record-management {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.current-record-info {
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 10px;
}

.record-management {
    justify-content: space-between;
}

.record-label {
    font-weight: bold;
    color: #495057;
}

.record-name {
    font-weight: bold;
    color: #007bff;
    padding: 4px 8px;
    background-color: #e3f2fd;
    border-radius: 4px;
    min-width: 120px;
    text-align: center;
}

.mgmt-btn {
    padding: 8px 16px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background-color: #ffffff;
    color: #495057;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.mgmt-btn:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
}

.mgmt-btn.primary {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

.mgmt-btn.primary:hover {
    background-color: #0056b3;
    border-color: #0056b3;
}

.save-status {
    font-size: 12px;
    color: #6c757d;
    font-style: italic;
}

.save-status.saving {
    color: #ffc107;
}

.save-status.success {
    color: #28a745;
}

.save-status.error {
    color: #dc3545;
}

.records-count {
    font-size: 14px;
    color: #6c757d;
}

/* 管理面板覆盖层 */
.management-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.management-panel {
    background-color: white;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #dee2e6;
    background-color: #f8f9fa;
}

.panel-header h3 {
    margin: 0;
    color: #495057;
    font-size: 18px;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #6c757d;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background-color: #e9ecef;
    color: #495057;
}

.panel-content {
    padding: 20px;
    max-height: calc(80vh - 80px);
    overflow-y: auto;
}

.new-record-section {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e9ecef;
}

.new-record-section input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
}

.new-record-section input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.records-section h4 {
    margin: 0 0 15px 0;
    color: #495057;
    font-size: 16px;
}

.records-list {
    max-height: 300px;
    overflow-y: auto;
}

.record-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    margin-bottom: 8px;
    background-color: #ffffff;
    transition: all 0.3s ease;
}

.record-item:hover {
    background-color: #f8f9fa;
    border-color: #dee2e6;
}

.record-item.active {
    background-color: #e3f2fd;
    border-color: #007bff;
}

.record-info {
    flex: 1;
}

.record-item-name {
    font-weight: bold;
    color: #495057;
    margin-bottom: 4px;
}

.record-item-date {
    font-size: 12px;
    color: #6c757d;
}

.record-actions {
    display: flex;
    gap: 8px;
}

.record-actions button {
    padding: 4px 8px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background-color: #ffffff;
    color: #495057;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

.record-actions button:hover {
    background-color: #e9ecef;
}

.record-actions button.delete {
    color: #dc3545;
    border-color: #dc3545;
}

.record-actions button.delete:hover {
    background-color: #dc3545;
    color: white;
}

.record-actions button.load {
    color: #007bff;
    border-color: #007bff;
}

.record-actions button.load:hover {
    background-color: #007bff;
    color: white;
}

/* 默认记录特殊样式 */
.record-item.default-record {
    background-color: #fff3cd;
    border-color: #ffc107;
    position: relative;
}

.record-item.default-record:hover {
    background-color: #ffecb5;
    border-color: #ffb300;
}

.record-item.default-record.active {
    background-color: #ffe082;
    border-color: #ff8f00;
}

.default-badge {
    display: inline-block;
    background-color: #ffc107;
    color: #856404;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: bold;
    margin-left: 8px;
    text-transform: uppercase;
}

.record-actions button.reset {
    color: #6c757d;
    border-color: #6c757d;
}

.record-actions button.reset:hover {
    background-color: #6c757d;
    color: white;
}

/* 确认对话框 */
.confirm-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.confirm-dialog-content {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    width: 90%;
    max-width: 400px;
    text-align: center;
}

.confirm-dialog-content h4 {
    margin: 0 0 15px 0;
    color: #dc3545;
}

.confirm-dialog-content p {
    margin: 0 0 20px 0;
    color: #495057;
}

.confirm-dialog-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.confirm-dialog-buttons button {
    padding: 8px 16px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    cursor: pointer;
}

.confirm-dialog-buttons button.confirm {
    background-color: #dc3545;
    color: white;
    border-color: #dc3545;
}

.confirm-dialog-buttons button.cancel {
    background-color: #6c757d;
    color: white;
    border-color: #6c757d;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .data-management-panel {
        padding: 10px;
    }

    .current-record-info, .record-management {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .current-record-info {
        border-bottom: none;
        padding-bottom: 0;
    }

    .management-panel {
        width: 95%;
        max-height: 90vh;
    }

    .new-record-section {
        flex-direction: column;
    }

    .record-item {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .record-actions {
        justify-content: center;
    }
}

/* 全局显示样式控制 */
.display-style-control {
    background-color: #f0f8ff;
    border: 1px solid #4a90e2;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.style-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    flex-wrap: wrap;
}

.dropdown-control, .checkbox-control {
    display: flex;
    align-items: center;
    gap: 10px;
}

.display-style-control label {
    font-weight: bold;
    color: #2c3e50;
    white-space: nowrap;
}

.display-style-control select {
    padding: 8px 12px;
    border: 1px solid #4a90e2;
    border-radius: 4px;
    background-color: white;
    font-size: 14px;
    cursor: pointer;
}

.display-style-control input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.checkbox-control label {
    cursor: pointer;
    user-select: none;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .style-controls {
        flex-direction: column;
        gap: 15px;
    }

    .dropdown-control, .checkbox-control {
        justify-content: center;
    }
}

/* 样式切换按钮 */
.style-toggle-btn {
    padding: 4px 8px;
    margin-left: 8px;
    border: 1px solid #4a90e2;
    border-radius: 4px;
    background-color: #e8f4fd;
    color: #2c3e50;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.style-toggle-btn:hover {
    background-color: #4a90e2;
    color: white;
}

.style-toggle-btn.small-btn {
    padding: 2px 4px;
    margin-left: 4px;
    font-size: 10px;
    line-height: 1;
}

/* 计算结果字段的容器 */
.result-field-container {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

h1, h2 {
    font-weight: bold;
}

table {
    border-collapse: collapse;
    width: 100%;
    margin-bottom: 20px;
}

.bordered-table th, .bordered-table td {
    border: 1px solid black;
    padding: 8px;
    text-align: center;
}

.calculation-table caption {
    caption-side: bottom;
    text-align: left;
    margin-top: 5px;
    font-size: 0.9em;
    color: red;
}

input[type="number"], input[type="text"] {
    width: 80px;
    text-align: center;
    border: 1px solid #ccc;
    border-radius: 4px;
}

input[readonly] {
    background-color: #f2f2f2;
}

.data-input p, .calculation p {
    margin: 10px 0;
}

.multiple-choice, .single-choice {
    margin-bottom: 20px;
}

.multiple-choice label, .single-choice label {
    margin-right: 15px;
}

button {
    padding: 5px 15px;
    border: 1px solid #000;
    background-color: #f0f0f0;
    cursor: pointer;
}

hr {
    margin: 30px 0;
}

sub {
    font-size: smaller;
}

/* Styles for manually drawn formulas */
.formula-line {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.fraction {
    display: inline-flex;
    flex-direction: column;
    text-align: center;
    vertical-align: middle;
    margin: 0 5px;
}

.numerator {
    border-bottom: 1px solid black;
    padding: 0 5px;
}

.denominator {
    padding: 0 5px;
}

/* New styles for the report and chart layout */
.report-container {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.report-container .bordered-table {
    flex: 1; /* Table takes up available space */
}

.chart-container {
    flex: 1; /* Chart container takes up available space */
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0; /* Prevent flex item from overflowing */
}

.controls {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.controls label {
    font-weight: bold;
}

.controls p {
    margin: 0;
}

/* 使用指南样式 */
.guide-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10001;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.guide-overlay.active {
    opacity: 1;
    visibility: visible;
}

.guide-modal {
    background-color: white;
    border-radius: 12px;
    max-width: 900px;
    width: 95%;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.guide-overlay.active .guide-modal {
    transform: scale(1);
}

.guide-header {
    background: linear-gradient(135deg, #4a90e2, #357abd);
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 12px 12px 0 0;
}

.guide-header h3 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

.guide-header .close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 32px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.guide-header .close-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.guide-content {
    padding: 0;
    max-height: 60vh;
    overflow-y: auto;
}

.guide-tabs {
    display: flex;
    background-color: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
    padding: 0 20px;
    overflow-x: auto;
}

.tab-btn {
    background: none;
    border: none;
    padding: 15px 20px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    color: #6c757d;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.tab-btn:hover {
    color: #495057;
    background-color: rgba(0, 0, 0, 0.05);
}

.tab-btn.active {
    color: #007bff;
    border-bottom-color: #007bff;
    background-color: white;
}

.guide-tab-content {
    padding: 30px;
}

.tab-pane {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-pane.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.tab-pane h4 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 22px;
    font-weight: 600;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

.tab-pane h5 {
    color: #34495e;
    margin: 20px 0 15px 0;
    font-size: 18px;
    font-weight: 600;
}

.tab-pane p {
    margin-bottom: 15px;
    line-height: 1.6;
    color: #555;
}

.tab-pane ol, .tab-pane ul {
    margin: 15px 0;
    padding-left: 25px;
}

.tab-pane li {
    margin-bottom: 10px;
    line-height: 1.6;
    color: #555;
}

.tab-pane strong {
    color: #2c3e50;
}

.tab-pane sub {
    font-size: 0.8em;
    vertical-align: sub;
}

.guide-actions {
    padding: 20px 30px;
    background-color: #f8f9fa;
    border-top: 1px solid #e9ecef;
    text-align: center;
    border-radius: 0 0 12px 12px;
}

.guide-link {
    text-align: center;
    margin-top: 15px;
}

.guide-link a {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.guide-link a:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .guide-modal {
        width: 98%;
        max-height: 90vh;
    }

    .guide-header {
        padding: 15px 20px;
    }

    .guide-header h3 {
        font-size: 20px;
    }

    .guide-tabs {
        padding: 0 10px;
    }

    .tab-btn {
        padding: 12px 15px;
        font-size: 14px;
    }

    .guide-tab-content {
        padding: 20px;
    }

    .tab-pane h4 {
        font-size: 20px;
    }

    .tab-pane h5 {
        font-size: 16px;
    }
}

/* 使用声明样式 */
.disclaimer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.disclaimer-overlay.active {
    opacity: 1;
    visibility: visible;
}

.disclaimer-modal {
    background-color: white;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.disclaimer-overlay.active .disclaimer-modal {
    transform: scale(1);
}

.disclaimer-header {
    background-color: #dc3545;
    color: white;
    padding: 20px 25px;
    border-radius: 12px 12px 0 0;
    text-align: center;
}

.disclaimer-header h3 {
    margin: 0;
    font-size: 1.5em;
    font-weight: bold;
}

.disclaimer-content {
    padding: 25px;
}

.disclaimer-section {
    margin-bottom: 25px;
}

.disclaimer-section:last-child {
    margin-bottom: 0;
}

.disclaimer-section h4 {
    color: #dc3545;
    margin: 0 0 15px 0;
    font-size: 1.2em;
    font-weight: bold;
}

.disclaimer-section ul {
    margin: 0;
    padding-left: 20px;
}

.disclaimer-section li {
    margin-bottom: 8px;
    line-height: 1.5;
    color: #333;
}

.disclaimer-section li:last-child {
    margin-bottom: 0;
}

.disclaimer-actions {
    padding: 20px 25px;
    border-top: 1px solid #e9ecef;
    background-color: #f8f9fa;
    border-radius: 0 0 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.checkbox-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.checkbox-wrapper input[type="checkbox"] {
    margin-top: 2px;
    flex-shrink: 0;
}

.checkbox-wrapper label {
    margin: 0;
    line-height: 1.4;
    color: #495057;
    cursor: pointer;
    font-weight: 500;
}

.confirm-btn {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
    align-self: flex-end;
}

.confirm-btn:hover {
    background-color: #218838;
}

.confirm-btn:active {
    transform: translateY(1px);
}

/* 次要按钮样式 */
.mgmt-btn.secondary {
    background-color: #6c757d;
    color: white;
    border-color: #6c757d;
}

.mgmt-btn.secondary:hover {
    background-color: #5a6268;
    border-color: #545b62;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .disclaimer-modal {
        width: 95%;
        max-height: 90vh;
    }

    .disclaimer-header,
    .disclaimer-content,
    .disclaimer-actions {
        padding: 15px 20px;
    }

    .disclaimer-header h3 {
        font-size: 1.3em;
    }

    .disclaimer-section h4 {
        font-size: 1.1em;
    }

    .confirm-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .disclaimer-section li {
        font-size: 14px;
    }

    .checkbox-wrapper {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}
