/* 舌像诊断页面专用样式 */

/* 全局样式 */
body {
    background-color: #f5f5f5;
    color: #333;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px 15px;
}

.page-header {
    text-align: center;
    border-bottom: 1px solid #eee;
    animation: fadeInDown 0.8s ease;
}

.page-title {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: #2c3e50;
    font-weight: 600;
}

.section-title {
    color: #2c3e50;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    padding-left: 15px;
    border-left: 4px solid #4A90E2;
    animation: fadeInLeft 0.5s ease;
}

.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    margin-bottom: 2rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: fadeInUp 0.8s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
}

.card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #eee;
    padding: 1.25rem 1.5rem;
}

.card-body {
    padding: 1.5rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    transition: all 0.2s;
}

.form-control:focus {
    border-color: #4A90E2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
    outline: none;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #444;
}

/* 按钮样式 */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
}

.btn:hover::after {
    width: 200%;
    height: 200%;
}

.btn-primary {
    background: linear-gradient(to right, #4A90E2, #5A5DE8);
    border: none;
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(to right, #3A80D2, #4A4DD8);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: #f8f8f8;
    border: 1px solid #ddd;
    color: #444;
}

.btn-secondary:hover {
    background-color: #eee;
}

.btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn:disabled::after {
    display: none;
}

/* 上传区域样式 */
.upload-container {
    margin: 15px 0;
    animation: fadeIn 0.8s ease;
}

.upload-area {
    border: 2px dashed #4A90E2;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    background-color: #f8f9fa;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 20px;
}

.upload-area:hover {
    background-color: #e9ecef;
    border-color: #357ABD;
}

.upload-area.dragover {
    border-color: #4A90E2;
    background-color: #e6f0fa;
    transform: scale(1.02);
}

.upload-preview {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.upload-placeholder {
    color: #6c757d;
    transition: all 0.3s ease;
}

.upload-placeholder i {
    margin-bottom: 10px;
    animation: pulse 2s infinite;
}

#previewImg {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 50%;
}

.upload-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* 提示区域 */
.alert {
    border-radius: 8px;
    border-left: 4px solid;
    animation: fadeIn 0.8s ease;
}

.alert-info {
    border-left-color: #4A90E2;
    background-color: rgba(74, 144, 226, 0.1);
}

.alert ul {
    padding-left: 25px;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .page-title {
        font-size: 1.5rem;
    }
    
    .section-title {
        font-size: 1.2rem;
    }
    
    .upload-preview {
        min-height: 150px;
    }
    
    #previewImg {
        max-height: 200px;
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    /* 调整卡片内边距 */
    .card {
        margin-bottom: 1rem;
    }

    .card-header {
        padding: 0.75rem 1rem;
    }

    .card-body {
        padding: 1rem;
    }

    /* 调整表单元素间距 */
    .form-group {
        margin-bottom: 1rem;
    }

    .form-control {
        padding: 0.5rem 0.75rem;
    }

    /* 调整历史记录卡片 */
    .history-card {
        margin-top: 1rem;
    }

    .history-card .card-header {
        padding: 0.75rem 1rem;
    }

    .history-card .card-header h2 {
        margin: 0;
        font-size: 1.2rem;
    }

    .history-card .card-header a {
        font-size: 0.9rem;
        white-space: nowrap;
        display: inline-block;
    }

    /* 调整表格样式 */
    .table-responsive {
        margin: 0 -10px;
    }

    .table th, .table td {
        padding: 0.5rem;
    }

    /* 调整按钮组 */
    .btn-group {
        display: flex;
        flex-wrap: nowrap;
    }

    .btn-group .btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.8rem;
    }
}

/* 动画 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from { 
        opacity: 0;
        transform: translateY(20px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from { 
        opacity: 0;
        transform: translateY(-20px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from { 
        opacity: 0;
        transform: translateX(-20px);
    }
    to { 
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

/* Additional button styles */
.btn-lg {
    font-size: 1.2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(50, 50, 93, 0.11), 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.btn-primary.btn-lg {
    background: linear-gradient(45deg, #4A90E2, #5A5DE8);
}

.btn-primary.btn-lg:hover {
    background: linear-gradient(45deg, #3A80D2, #4A4DD8);
    transform: translateY(-2px);
    box-shadow: 0 7px 14px rgba(50, 50, 93, 0.1), 0 3px 6px rgba(0, 0, 0, 0.08);
}

.btn-content {
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
}

.form-section-title {
    font-size: 1.25rem;
    color: #2c3e50;
    margin-bottom: 1rem;
    font-weight: 500;
    border-left: 3px solid #4A90E2;
    padding-left: 10px;
}

/* Show loading state */
.btn.is-loading .btn-content {
    opacity: 0.8;
}

.btn.is-loading .spinner-border {
    display: inline-block !important;
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

/* 新的loading状态，适用于is-loading类 */
#submitBtn.is-loading .btn-content {
    opacity: 0.8;
}

#submitBtn.is-loading .spinner-border {
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    display: inline-block !important;
}

/* 拍照引导样式 */
.camera-guide-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.camera-guide-overlay.show {
    opacity: 1;
}

.camera-guide-overlay.fade-out {
    opacity: 0;
}

.camera-guide-content {
    width: 90%;
    max-width: 400px;
    background-color: #fff;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    text-align: center;
}

.guide-header {
    font-size: 20px;
    font-weight: bold;
    color: #333;
    margin-bottom: 20px;
}

.guide-circle-container {
    position: relative;
    width: 100%;
    height: 240px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #000;
    border-radius: 8px;
    margin-bottom: 20px;
    overflow: hidden;
}

.guide-circle {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    border: 4px dashed rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 0 1000px rgba(0, 0, 0, 0.5),\
                inset 0 0 20px rgba(255, 255, 255, 0.3);
    animation: pulse-guide 2s infinite;
}

.guide-text {
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
    max-width: 120px;
    text-align: center;
}

.guide-instructions {
    margin-bottom: 20px;
}

.guide-instructions ul {
    text-align: left;
    padding-left: 20px;
    margin-bottom: 0;
}

.guide-instructions li {
    margin-bottom: 8px;
    color: #555;
}

.guide-button {
    background: linear-gradient(to right, #4A90E2, #5A5DE8);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 500;
    width: 100%;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.guide-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(74, 144, 226, 0.3);
}

@keyframes pulse-guide {
    0% {
        border-color: rgba(255, 255, 255, 0.9);
        box-shadow: 0 0 0 1000px rgba(0, 0, 0, 0.5),\
                    inset 0 0 20px rgba(255, 255, 255, 0.3);
    }
    50% {
        border-color: rgba(255, 255, 255, 0.6);
        box-shadow: 0 0 0 1000px rgba(0, 0, 0, 0.5),\
                    inset 0 0 30px rgba(255, 255, 255, 0.5);
    }
    100% {
        border-color: rgba(255, 255, 255, 0.9);
        box-shadow: 0 0 0 1000px rgba(0, 0, 0, 0.5),\
                    inset 0 0 20px rgba(255, 255, 255, 0.3);
    }
}

/* 舌像上传样式 */
.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;
}

.is-invalid-border {
    border: 1px dashed #dc3545 !important; /* Bootstrap's red for invalid feedback */
}

.is-invalid-border:hover {
    border-color: #dc3545 !important; /* 保持红色 */
    background-color: #fcebeb !important; /* 浅红色背景 */
}

/* 确保错误信息和星号醒目显示 */
.invalid-feedback {
    color: #dc3545 !important;
    font-weight: bold !important;
}

.text-danger {
    color: #dc3545 !important;
    font-weight: bold !important;
}

/* 修复样式问题 */
.history-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    margin-bottom: 2rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: fadeInUp 0.8s ease;
}

.history-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
}

.history-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f8f9fa;
    border-bottom: 1px solid #eee;
    padding: 1rem;
}

.history-card .card-header h2 {
    margin: 0;
    font-size: 1.25rem;
    color: #2c3e50;
}

.history-card .card-header a {
    color: #6c757d;
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.history-card .card-header a:hover {
    color: #4A90E2;
    background-color: rgba(74, 144, 226, 0.1);
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th, .table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.table th {
    background-color: #f8f9fa;
    font-weight: 500;
    color: #2c3e50;
}

.table tbody tr:hover {
    background-color: rgba(74, 144, 226, 0.05);
}

.btn-info {
    background-color: #17a2b8;
    border-color: #17a2b8;
    color: white;
}

.btn-info:hover {
    background-color: #138496;
    border-color: #117a8b;
    color: white;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    line-height: 1.5;
}

.is-invalid {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
}

.disclaimer {
    background-color: rgba(255, 193, 7, 0.08);
    border-left-width: 5px;
    padding: 16px 20px;
}

.disclaimer .alert-heading {
    font-size: 1.1rem;
    font-weight: 600;
    color: #856404;
}

/* 增强的提示和免责声明区样式 */
.tips-box, .disclaimer {
    padding: 16px 20px;
    border-radius: 10px;
}

.tips-box {
    background-color: rgba(74, 144, 226, 0.08);
    border-left-width: 5px;
}

/* 清除按钮样式优化 */
#removeImgBtn {
    position: absolute !important;
    top: 10px !important;
    right: 10px !important;
    background-color: rgba(220, 53, 69, 0.8);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    z-index: 10;
}

#removeImgBtn:hover {
    background-color: rgba(220, 53, 69, 1);
}

/* 舌诊页面样式 */
.tongue-diagnosis-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.tongue-image-container {
    position: relative;
    margin-bottom: 20px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.tongue-image {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s;
}

.tongue-image:hover {
    transform: scale(1.02);
}

/* 打印样式 */
@media print {
    .upload-area,
    .btn-primary,
    .history-section {
        display: none;
    }

    .analysis-result {
        box-shadow: none;
        border: 1px solid #ddd;
    }

    .tongue-image {
        max-width: 100%;
        height: auto;
    }
} 