.diagnosis-form {
    max-width: 100%;
    margin: 0 auto;
    padding: 20px;
}

.form-section {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    width: 100%;
    box-sizing: border-box;
}

.form-section h2 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 1.2rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    width: 100%;
    box-sizing: border-box;
}

.form-group {
    flex: 1;
    width: 100%;
    box-sizing: border-box;
}

.form-label {
    display: block;
    margin-bottom: 5px;
    color: #666;
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    box-sizing: border-box;
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

.form-actions {
    text-align: center;
    margin-top: 30px;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s;
    margin: 0 5px;
}

.btn-primary {
    background: #4A90E2;
    color: white;
}

.btn-primary:hover {
    background: #357ABD;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-primary:disabled, .btn-secondary:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.analysis-result {
    display: none;
    margin-top: 30px;
    width: 100%;
    box-sizing: border-box;
}

.analysis-result.show {
    display: block;
}

.loading {
    display: none;
    text-align: center;
    margin: 20px 0;
}

.loading.show {
    display: block;
}

.spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: #4A90E2;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-message {
    color: #dc3545;
    margin-top: 5px;
    font-size: 0.85rem;
}

/* 历史处方弹窗样式 */
#historyModal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 95%;
    max-width: 100%;
    border-radius: 8px;
    max-height: 80vh;
    overflow-y: auto;
    box-sizing: border-box;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: black;
}

.prescription-list {
    list-style: none;
    padding: 0;
    margin: 0;
    width: 100%;
    box-sizing: border-box;
}

.prescription-item {
    padding: 15px;
    margin-bottom: 10px;
    border: 1px solid #eee;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    width: 100%;
    box-sizing: border-box;
}

.prescription-item:hover {
    background-color: #f9f9f9;
}

.prescription-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.prescription-name {
    font-weight: bold;
}

.prescription-date {
    color: #777;
    font-size: 0.9em;
}

.prescription-symptoms {
    color: #555;
    margin-bottom: 8px;
    font-style: italic;
}

.prescription-formula {
    font-weight: 500;
}

.disclaimer {
    margin-top: 30px; 
    padding: 15px; 
    background-color: #f8f9fa; 
    border-left: 4px solid #6c757d; 
    border-radius: 4px;
}

.disclaimer p {
    margin: 0; 
    color: #495057; 
    font-size: 14px; 
    line-height: 1.5;
}

@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }
    
    .diagnosis-form {
        padding: 10px;
        width: 100%;
        max-width: 100%;
    }
    
    .form-group {
        width: 100%;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
        max-width: 100%;
    }
    
    .container {
        padding: 5px;
        width: 100%;
        max-width: 100%;
    }
    
    .form-section {
        padding: 15px;
        width: 100%;
    }
    
    .symptom-categories {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    
    .quick-symptoms {
        width: 100%;
        padding: 8px;
    }
}

@media (prefers-color-scheme: dark) {
    .form-section {
        background: #2d2d2d;
    }
    
    .form-section h2 {
        color: #fff;
        border-bottom-color: #444;
    }
    
    .form-label {
        color: #ccc;
    }
    
    .form-control {
        background: #333;
        border-color: #444;
        color: #fff;
    }
    
    .form-control:focus {
        border-color: #4A90E2;
        background: #383838;
    }
    
    .modal-content {
        background-color: #2d2d2d;
        border-color: #444;
    }
    
    .close {
        color: #ccc;
    }
    
    .close:hover {
        color: #fff;
    }
    
    .prescription-item {
        border-color: #444;
    }
    
    .prescription-item:hover {
        background-color: #383838;
    }
    
    .prescription-date {
        color: #aaa;
    }
    
    .prescription-symptoms {
        color: #bbb;
    }
    
    .spinner {
        border-color: rgba(255, 255, 255, 0.1);
        border-top-color: #4A90E2;
    }
    
    .disclaimer {
        background-color: #333;
        border-left-color: #555;
    }
    
    .disclaimer p {
        color: #ccc;
    }
}

/* 添加快捷按钮样式 */
.quick-symptoms {
    margin-top: 10px;
    background-color: #f9f9f9;
    border-radius: 5px;
    padding: 10px;
    border: 1px solid #e0e0e0;
    width: 100%;
    box-sizing: border-box;
}

.quick-title {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
    border-bottom: 1px dashed #ddd;
    padding-bottom: 5px;
}

.quick-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    width: 100%;
    box-sizing: border-box;
}

.quick-btn {
    background-color: #f0f7ff;
    border: 1px solid #d0e3ff;
    color: #3273dc;
    border-radius: 15px;
    padding: 3px 10px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.quick-btn:hover {
    background-color: #e0f0ff;
    border-color: #a0c8ff;
}

.quick-btn:active {
    background-color: #d0e0ff;
    transform: translateY(1px);
}

/* 适配暗色模式 */
@media (prefers-color-scheme: dark) {
    .quick-symptoms {
        background-color: #2c3034;
        border-color: #495057;
    }
    
    .quick-title {
        color: #adb5bd;
        border-bottom-color: #495057;
    }
    
    .quick-btn {
        background-color: #212529;
        border-color: #343a40;
        color: #adb5bd;
    }
    
    .quick-btn:hover {
        background-color: #343a40;
        border-color: #495057;
    }
}

/* 辨证页面样式 */
.diagnosis-form-card {
    margin-bottom: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.section-title {
    color: #333;
    font-size: 1.2em;
    margin-bottom: 15px;
}

.patient-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #555;
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: border-color 0.3s;
}

.form-control:focus {
    border-color: #4A90E2;
    outline: none;
}

.symptom-item {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
}

.symptom-item input[type="text"] {
    flex: 1;
    margin-right: 10px;
}

.symptom-item select {
    width: 120px;
}

.btn-add-symptom {
    margin-bottom: 15px;
}

.form-actions {
    text-align: center;
    margin-top: 30px;
}

.btn-primary {
    background: #4A90E2;
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 1.1em;
}

.btn-primary:hover {
    background: #357ABD;
}

.disclaimer {
    margin-top: 30px;
    padding: 15px;
    background-color: #f8f9fa;
    border-left: 4px solid #6c757d;
    border-radius: 4px;
}

.history-card {
    margin-top: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.table {
    width: 100%;
    margin-bottom: 0;
}

.table th {
    background: #f8f9fa;
    font-weight: 600;
}

.table td, .table th {
    padding: 12px;
    vertical-align: middle;
}

.btn-sm {
    padding: 4px 8px;
    font-size: 0.875em;
}

.btn-info {
    background: #17a2b8;
    color: white;
    border: none;
}

.btn-info:hover {
    background: #138496;
}

/* 症状标签样式 */
.symptom-categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
    width: 100%;
}

.symptom-category {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background-color: #f9f9f9;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background-color: #f0f0f0;
    cursor: pointer;
    user-select: none;
}

.category-header h4 {
    margin: 0;
    font-size: 14px;
    color: #333;
}

.toggle-icon {
    font-size: 12px;
    color: #666;
    transition: transform 0.3s ease;
}

.category-header.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

.symptom-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px;
    max-height: 120px;
    overflow-y: auto;
    width: 100%;
    box-sizing: border-box;
}

.symptom-tags.collapsed {
    display: none;
}

.quick-btn {
    padding: 4px 8px;
    border: 1px solid #4CAF50;
    border-radius: 4px;
    background-color: white;
    color: #4CAF50;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.quick-btn:hover {
    background-color: #4CAF50;
    color: white;
}

.quick-btn.warning {
    border-color: #f44336;
    color: #f44336;
}

.quick-btn.warning:hover {
    background-color: #f44336;
    color: white;
}

/* 新增舌像上传样式 */
.tongue-image-upload-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
}

.image-upload-section {
    flex: 1;
    min-width: 300px; /* 确保在小屏幕下也有足够宽度 */
}

.upload-container {
    border: 1px dashed #ccc;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    background-color: #f9f9f9;
    transition: border-color 0.3s ease, background-color 0.3s ease;
}

.upload-container:hover {
    border-color: #4CAF50;
    background-color: #f0fdf0;
}

.upload-area {
    position: relative;
    height: 200px; /* 固定高度，可根据需要调整 */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 15px;
}

.upload-preview {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #e9ecef; /* 浅灰色背景 */
    border-radius: 4px;
    overflow: hidden;
}

.upload-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain; /* 保持图片比例 */
}

.upload-placeholder {
    color: #6c757d;
    font-size: 1.1em;
}

.upload-placeholder i {
    margin-bottom: 10px;
    color: #888;
}

.upload-actions .btn {
    margin: 5px;
} 