/* 基础模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    transition: background-color 0.3s ease-out;
}

.modal.show {
    animation: modalFadeIn 0.3s ease-out;
}

.modal.hide {
    background-color: rgba(0, 0, 0, 0);
}

.modal.hide .modal-content {
    animation: modalFadeOut 0.3s ease-out;
}

.modal-content {
    position: relative;
    background-color: #fff;
    margin: 6vh auto;
    padding: 25px;
    width: 65%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 20px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    transform-origin: top right;
}

/* 头部样式 */
.modal-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #fff;
    margin: -25px -25px 20px -25px;
    padding: 25px 25px 15px 25px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 20px 20px 0 0;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.3em;
    font-weight: 600;
    line-height: 1.4;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: calc(100% - 40px);
}

.close {
    position: relative;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    background: none;
    border: none;
    padding: 8px;
    margin: -8px -8px -8px 7px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    transform-origin: center;
}

.close:hover {
    background-color: rgba(0, 0, 0, 0.05);
    transform: scale(1.1);
}

.close:active {
    background-color: rgba(0, 0, 0, 0.1);
    transform: scale(0.95);
}

/* 眼睛样式 */
.close span {
    position: absolute;
    width: 4px;
    height: 4px;
    background-color: #666;
    border-radius: 50%;
    top: 12px;
    transition: all 0.2s ease;
}

.close span:first-child {
    left: 12px;
}

.close span:last-child {
    right: 12px;
}

/* 嘴巴样式（使用伪元素） */
.close::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 2px;
    background-color: #666;
    border-radius: 1px;
    bottom: 12px;
    transform: rotate(-10deg);
    transition: all 0.2s ease;
}

/* 悬停效果 */
.close:hover span {
    height: 5px;
    transform: scaleY(0.8);
}

.close:hover::after {
    transform: rotate(-15deg) scaleX(1.2);
    bottom: 11px;
}

/* 点击效果 */
.close:active span {
    transform: scaleY(0.5);
}

.close:active::after {
    transform: rotate(-20deg) scaleX(0.9);
    bottom: 10px;
}

/* 内容区域样式 */
.modal-body {
    text-align: left;
    padding-top: 5px;
}

/* 标题样式 */
h3 {
    font-size: 1.3em;
    font-weight: 600;
    margin: 20px 0 12px;
    color: #333;
}

h4 {
    font-size: 1.1em;
    font-weight: 600;
    margin: 16px 0 8px;
    color: #444;
}

/* 文本样式 */
p {
    margin: 8px 0;
    line-height: 1.6;
    color: #333;
}

ul {
    margin: 8px 0;
    padding-left: 24px;
}

li {
    margin: 6px 0;
    line-height: 1.5;
}

/* 区块样式 */
.intro-section,
.algorithm-section,
.matching-levels,
.dynamic-adjustment {
    margin: 20px 0;
    padding: 0;
}

.highlight-box {
    margin: 12px 0;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
}

/* 数学公式样式 */
.math-formula {
    margin: 20px 0;
    padding: 15px 0;
    text-align: left;
    overflow-x: auto;
    position: relative;
}

.math-formula .MathJax {
    font-size: 120% !important;
    max-width: 100% !important;
}

.math-formula .MathJax_Display {
    margin: 1em 0 !important;
}

.formula-explanation {
    margin-top: 8px;
    color: #666;
    font-size: 0.9em;
}

/* 匹配等级样式 */
.level-item {
    margin: 12px 0;
    padding: 0;
    display: flex;
    align-items: flex-start;
}

.level-badge {
    display: inline-block;
    width: 24px;
    height: 24px;
    line-height: 24px;
    text-align: center;
    border-radius: 50%;
    margin-right: 8px;
    font-weight: 600;
    color: #fff;
}

.level-desc {
    text-align: left;
    line-height: 1.5;
}

.s-level .level-badge {
    background-color: #e74c3c;
}

.a-level .level-badge {
    background-color: #3498db;
}

/* 滚动条样式 */
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    border: 2px solid #f5f5f5;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* 公式滚动条 */
.math-formula::-webkit-scrollbar {
    height: 4px;
}

.math-formula::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 2px;
}

.math-formula::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 2px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .modal-content {
        width: 85%;
        padding: 20px;
        margin: 4vh auto;
    }

    .modal-header {
        margin: -20px -20px 15px -20px;
        padding: 20px;
    }

    .modal-header h2 {
        font-size: 1.2em;
    }

    h3 {
        font-size: 1.1em;
    }

    h4 {
        font-size: 1em;
    }

    .math-formula {
        font-size: 90%;
    }

    .math-formula .MathJax {
        font-size: 90% !important;
    }
}

@media (max-width: 480px) {
    .modal-content {
        width: 90%;
        padding: 15px;
        margin: 3vh auto;
    }

    .modal-header {
        margin: -15px -15px 15px -15px;
        padding: 15px;
    }

    .modal-header h2 {
        font-size: 1.1em;
    }

    h3 {
        font-size: 1em;
    }

    h4 {
        font-size: 0.9em;
    }

    .math-formula {
        font-size: 80%;
        padding: 10px 0;
    }

    .math-formula .MathJax {
        font-size: 80% !important;
    }

    .formula-explanation {
        font-size: 0.85em;
    }
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes modalFadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.95);
    }
} 
/* 适配模态窗口 */
.terms-modal-content, 
.trauma-modal-content {
    width: 90%;
    max-height: 80vh;
}
/* 服务协议模态框样式 */
#terms-modal {
    display: none;
    position: fixed;
    z-index: 2000; /* 高于创伤模态框的z-index */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.terms-modal-content {
    position: relative;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    background-color: #fff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    animation: fadeInUp 0.5s ease-out;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    margin: 30px auto;
}

.terms-content {
    overflow-y: auto;
    max-height: calc(80vh - 100px);
    padding-right: 10px;
}

.terms-content::-webkit-scrollbar {
    width: 8px;
}

.terms-content::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 4px;
}

.terms-content::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    border: 2px solid #f5f5f5;
}

.terms-content::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

.terms-section {
    display: none;
}

body.english .terms-section.en,
body.chinese .terms-section.zh,
body.japanese .terms-section.ja,
body.russian .terms-section.ru,
body.french .terms-section.fr {
    display: block;
}

.terms-date {
    color: #666;
    font-style: italic;
    margin-bottom: 20px;
}

.terms-actions {
    margin-top: 20px;
    text-align: center;
}

#terms-modal .close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    color: #666;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 2001;
}

#terms-modal .close-modal:hover {
    color: #333;
    transform: scale(1.1);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 响应式调整 */
@media (max-width: 768px) {
    .terms-modal-content {
        padding: 20px 15px;
    }
    
    .terms-content h2 {
        font-size: 1.5rem;
    }
    
    .terms-content h3 {
        font-size: 1.2rem;
    }
    
    .terms-content h4 {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .terms-modal-content {
        width: 95%;
        padding: 15px;
    }
    
    .terms-content {
        max-height: calc(80vh - 70px);
    }
    
    .terms-content h2 {
        font-size: 1.3rem;
    }
}

/* 服务协议模态框样式 - 使用gdl-terms前缀确保类名唯一性 */
.gdl-terms-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    padding: 0;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.gdl-terms-modal-content {
    position: relative;
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    background-color: #f8fafd;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: gdlSlideUp 0.4s cubic-bezier(0.19, 1, 0.22, 1);
    border: 1px solid #e3e8f0;
}

@keyframes gdlSlideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.gdl-terms-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f0f2f5;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
    color: #888;
}

.gdl-terms-close:hover {
    background: #e3e8f0;
    color: #ff6b6b;
}

.gdl-terms-content {
    overflow-y: auto;
    max-height: calc(85vh - 60px);
    padding: 40px;
    color: #222;
}

/* 现代化的滚动条样式 */
.gdl-terms-content::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.gdl-terms-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

.gdl-terms-content::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.gdl-terms-content::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* 标题和文本样式 */
.gdl-terms-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 16px;
    color: #222;
}

.gdl-terms-subtitle {
    font-size: 22px;
    font-weight: 600;
    margin: 24px 0 12px;
    color: #333;
}

.gdl-terms-date {
    font-size: 14px;
    color: #888;
    margin-bottom: 24px;
}

.gdl-terms-provider {
    font-weight: 600;
    margin-bottom: 8px;
}

.gdl-terms-section {
    margin-top: 20px;
}

/* 正文内容样式优化 */
.gdl-terms-section h4 {
    font-size: 18px;
    font-weight: 600;
    margin: 24px 0 12px;
    color: #222;
}

.gdl-terms-section p {
    margin-bottom: 16px;
    line-height: 1.6;
    color: #333;
}

.gdl-terms-section ul {
    margin: 0 0 16px 24px;
    padding: 0;
}

.gdl-terms-section ul li {
    margin-bottom: 8px;
    line-height: 1.5;
    color: #333;
}

.gdl-terms-section ul ul {
    margin-top: 8px;
}

/* 链接样式 */
.gdl-terms-link {
    text-decoration: none;
    transition: color 0.2s;
    color: #ff6b6b;
}

.gdl-terms-link:hover {
    text-decoration: underline;
    color: #d94c4c;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .gdl-terms-modal-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .gdl-terms-content {
        padding: 30px 20px;
    }
    
    .gdl-terms-title {
        font-size: 24px;
    }
    
    .gdl-terms-subtitle {
        font-size: 20px;
    }
}
