* {
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

:root {
    --primary-color: #4268cf;
    --primary-hover: #375bca;
    --secondary-color: #ff6b6b;
    --text-color: #444444;
    --heading-color: #273044;
    --light-bg: #f8f9fa;
    --card-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
    --border-radius: 10px;
    --transition: all 0.3s ease;
}

html {
    line-height: 1.15;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    font-size: 15px;
}

body {
    font-family: 'Microsoft YaHei', 'Segoe UI', Tahoma, Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: -webkit-linear-gradient(315deg, #f5f7fa 0%, #e0e4f0 100%);
    background: -moz-linear-gradient(315deg, #f5f7fa 0%, #e0e4f0 100%);
    background: -o-linear-gradient(315deg, #f5f7fa 0%, #e0e4f0 100%);
    background: linear-gradient(135deg, #f5f7fa 0%, #e0e4f0 100%);
    padding: 10px;
    min-height: 100vh;
    margin: 0;
    font-size: 0.95rem;
}

.container {
    max-width: 800px;
    margin: 10px auto;
    background: #fff;
    padding: 20px;
    -webkit-border-radius: var(--border-radius);
    -moz-border-radius: var(--border-radius);
    border-radius: var(--border-radius);
    -webkit-box-shadow: var(--card-shadow);
    -moz-box-shadow: var(--card-shadow);
    box-shadow: var(--card-shadow);
    background-image: -webkit-linear-gradient(top, rgba(255, 255, 255, 0.97), rgba(255, 255, 255, 1));
    background-image: -moz-linear-gradient(top, rgba(255, 255, 255, 0.97), rgba(255, 255, 255, 1));
    background-image: -o-linear-gradient(top, rgba(255, 255, 255, 0.97), rgba(255, 255, 255, 1));
    background-image: linear-gradient(to bottom, rgba(255, 255, 255, 0.97), rgba(255, 255, 255, 1));
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

h1 {
    font-size: 1.8rem;
    color: var(--heading-color);
    text-align: center;
    margin-bottom: 5px;
    position: relative;
    padding-bottom: 0;
}

h1:after {
    display: none;
}

.form-group {
    margin-bottom: 18px;
    position: relative;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--heading-color);
    font-size: 0.9rem;
}

select, input[type="number"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e8e8e8;
    border-radius: var(--border-radius);
    font-size: 15px;
    background-color: #fff;
    color: var(--text-color);
    transition: border-color 0.3s, box-shadow 0.3s;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

select:focus, input[type="number"]:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(66, 104, 207, 0.1);
    outline: none;
}

.radio-group {
    display: flex;
    gap: 20px;
    margin-top: 5px;
}

.radio-group input[type="radio"] {
    margin-right: 8px;
    accent-color: var(--primary-color);
}

.rating, .bonus {
    margin-top: 10px;
    font-size: 14px;
    color: var(--primary-color);
    background-color: rgba(66, 104, 207, 0.07);
    padding: 7px 10px;
    border-radius: var(--border-radius);
    display: inline-block;
    border: 1px solid rgba(66, 104, 207, 0.1);
}

.result-container {
    background: #fbfbfb;
    padding: 15px;
    border-radius: var(--border-radius);
    text-align: center;
    margin: 15px 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
    display: none;
    border: 1px solid #f0f0f0;
}

.result-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.result-container h3 {
    font-size: 1rem;
    margin: 0;
    font-weight: 600;
    color: var(--heading-color);
    display: flex;
    align-items: center;
}

.result-container h3 i {
    margin-right: 8px;
    color: var(--primary-color);
}

.score {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
}

button {
    background: linear-gradient(to right, var(--primary-color), var(--primary-hover));
    color: white;
    border: none;
    padding: 11px 20px;
    font-size: 15px;
    border-radius: var(--border-radius);
    cursor: pointer;
    width: 100%;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(66, 104, 207, 0.2);
    margin-top: 5px;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(66, 104, 207, 0.25);
}

button:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(66, 104, 207, 0.15);
}

button i {
    margin-right: 8px;
}

/* 弹窗式加载指示器 */
.loading-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.45);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    backdrop-filter: blur(3px);
}

.loading-modal.active {
    display: flex;
    opacity: 1;
    visibility: visible;
}

.loading-content {
    background-color: white;
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    text-align: center;
    max-width: 300px;
    width: 90%;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.loading-spinner {
    display: inline-block;
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    font-size: 16px;
    color: var(--heading-color);
    font-weight: 500;
}

/* 错误消息样式 */
.error-message {
    color: #e74c3c;
    background-color: #fdf3f2;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #e74c3c;
    margin-bottom: 20px;
    font-weight: 500;
}

/* 纯文本显示样式 */
.plain-text {
    white-space: pre-wrap;
    font-family: 'Microsoft YaHei', 'Segoe UI', Tahoma, Arial, sans-serif;
    line-height: 1.6;
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    border: 1px solid #e9ecef;
    color: #444;
    font-size: 0.95rem;
}

/* 媒体查询适配手机等小屏幕设备 */
@media (max-width: 768px) {
    .container {
        padding: 15px 12px;
        margin: 5px auto;
        width: 98%;
    }
    
    h1 {
        font-size: 1.6rem;
    }
    
    .subtitle {
        font-size: 0.9rem;
        margin-top: -10px;
    }
    
    .form-card {
        margin-bottom: 15px;
    }
    
    .form-section {
        padding: 10px;
        margin-bottom: 10px;
    }
    
    .section-title {
        font-size: 1rem;
        margin-bottom: 14px;
        padding-bottom: 6px;
    }
    
    .form-group {
        margin-bottom: 14px;
    }
    
    label {
        font-size: 0.85rem;
        margin-bottom: 5px;
    }
    
    select, input[type="number"] {
        padding: 8px 10px;
        font-size: 14px;
    }
    
    .rating, .bonus {
        font-size: 12px;
        padding: 5px 8px;
        margin-top: 6px;
    }
    
    .radio-group {
        gap: 12px;
    }
    
    .result-container {
        margin: 12px 0;
        padding: 12px;
    }
    
    .result-container h3 {
        font-size: 0.9rem;
    }
    
    .score {
        font-size: 22px;
    }
    
    button {
        padding: 10px;
        font-size: 14px;
    }
    
    .form-footer {
        margin-top: 15px;
        font-size: 0.8rem;
    }
    
    select, input[type="number"], button {
        max-width: 100%;
        box-sizing: border-box;
    }
}

/* 超小屏幕设备优化 */
@media (max-width: 480px) {
    .container {
        padding: 10px 8px;
        margin: 3px auto;
        width: 99%;
    }
    
    .app-header h1 {
        font-size: 1.5rem;
    }
    
    .subtitle {
        font-size: 0.85rem;
    }
    
    .form-section {
        padding: 10px;
    }
    
    .form-group {
        margin-bottom: 12px;
    }
    
    .section-title {
        margin-bottom: 12px;
        font-size: 1rem;
    }
    
    select, input[type="number"] {
        padding: 6px 8px;
        font-size: 14px;
    }
    
    .rating, .bonus {
        font-size: 11px;
        padding: 4px 6px;
        margin-top: 4px;
    }
    
    .radio-group {
        gap: 8px;
    }
    
    .radio-label {
        font-size: 14px;
    }
    
    .result-container {
        margin: 10px 0;
        padding: 10px;
    }
    
    .score {
        font-size: 20px;
    }
    
    button {
        padding: 8px;
        font-size: 13px;
        margin-top: 5px;
    }
    
    .loading-content, .result-content {
        width: 95%;
        padding: 12px;
    }
    
    .loading-spinner {
        width: 40px;
        height: 40px;
        border-width: 3px;
    }
    
    .loading-text {
        font-size: 15px;
    }
    
    /* 学校信息两个下拉框在小屏幕上进一步优化 */
    .form-section:first-child .section-title + .form-group,
    .form-section:first-child .section-title + .form-group + .form-group {
        width: calc(50% - 5px);
    }
    
    .form-section:first-child .section-title + .form-group {
        margin-right: 5px;
    }
    
    .form-section:first-child .section-title + .form-group + .form-group {
        margin-left: 5px;
    }
    
    /* 标签文字更小 */
    .school-info-section .form-group label,
    .form-section .form-group label {
        font-size: 11px;
        margin-bottom: 4px;
    }
    
    /* 下拉框内文字更小 */
    .school-info-section select,
    .form-section select,
    .form-section input[type="number"] {
        font-size: 11px;
        padding: 8px 6px;
    }
}

.highlight {
    color: var(--primary-color);
    font-weight: 700;
}

/* 结果弹窗样式优化 */
.result-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    backdrop-filter: blur(3px);
}

.result-modal.active {
    opacity: 1;
    visibility: visible;
    display: flex !important;
}

.result-content {
    background: white;
    padding: 0;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    position: relative;
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    overflow-y: auto;
    transform: scale(0.95);
    transition: transform 0.3s, opacity 0.3s;
    opacity: 0;
}

.result-modal.active .result-content {
    transform: scale(1);
    opacity: 1;
}

.result-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #eaeaea;
    padding: 15px 20px;
    border-radius: 12px 12px 0 0;
}

.result-header h2 {
    font-size: 20px;
    color: #333;
    margin: 0;
}

#modalResult {
    padding: 20px;
    max-height: 70vh;
    overflow-y: auto;
}

.close-button {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #f5f5f5;
    border: 1px solid #eaeaea;
    font-size: 18px;
    color: #555;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.close-button:hover {
    background: #eaeaea;
}

/* 结果内容样式优化 */
.result-header {
    border-bottom: 1px solid #eaeaea;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.result-header h2 {
    color: var(--primary-color);
    font-size: 1.6rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}

.result-header h2 i {
    margin-right: 10px;
    color: var(--primary-color);
}

.user-info {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    border: 1px solid #eaeaea;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.info-row {
    display: flex;
    align-items: center;
    font-size: 0.95rem;
    padding: 8px 12px;
    background-color: #fff;
    border-radius: 6px;
    border: 1px solid #f0f0f0;
}

.info-label {
    font-weight: 600;
    color: #555;
    margin-right: 8px;
    display: flex;
    align-items: center;
    min-width: 110px;
}

.info-label i {
    margin-right: 8px;
    color: #3498db;
    font-size: 1.1em;
}

.info-value {
    color: #333;
}

.info-value.highlight {
    color: #e74c3c;
    font-weight: 700;
    font-size: 1.1em;
}

/* 学校和专业列表样式 */
.intro-text {
    margin-bottom: 20px;
    line-height: 1.6;
    color: #333;
    border-left: 3px solid #3498db;
    padding-left: 15px;
    background: #f5f9ff;
    padding: 10px 15px;
    border-radius: 0 5px 5px 0;
    font-size: 0.9rem;
}

.schools-container {
    display: flex;
    flex-direction: column;
    gap: 25px;
    margin-top: 20px;
}

.school-card {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.05);
    -webkit-border-radius: 8px;
    -moz-border-radius: 8px;
    border-radius: 8px;
    margin-bottom: 20px;
    -webkit-box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
    -moz-box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
    -webkit-transition: box-shadow 0.3s, transform 0.3s;
    -moz-transition: box-shadow 0.3s, transform 0.3s;
    -o-transition: box-shadow 0.3s, transform 0.3s;
    transition: box-shadow 0.3s, transform 0.3s;
    overflow: hidden;
}

.school-card:hover {
    -webkit-box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    -moz-box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    -webkit-transform: translateY(-2px);
    -moz-transform: translateY(-2px);
    -ms-transform: translateY(-2px);
    -o-transform: translateY(-2px);
    transform: translateY(-2px);
}

.school-header {
    background: linear-gradient(135deg, #3498db, #2980b9);
    padding: 15px;
}

.school-number {
    background: white;
    color: #3498db;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: bold;
    margin-right: 12px;
}

.school-name {
    margin: 0;
    font-size: 1.2em;
    -webkit-hyphens: auto;
    -moz-hyphens: auto;
    -ms-hyphens: auto;
    hyphens: auto;
    word-wrap: break-word;
    word-break: break-word;
}

.school-details {
    padding: 15px;
}

.school-description {
    margin-bottom: 15px;
    line-height: 1.6;
    color: #444;
}

.majors-section {
    margin-top: 15px;
}

.majors-section h4 {
    color: #2c3e50;
    font-size: 1.1em;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.majors-section h4 i {
    margin-right: 8px;
    color: #e74c3c;
}

.majors-list {
    list-style: none;
    padding-left: 0;
    margin-bottom: 15px;
}

.major-item {
    margin-bottom: 8px;
    padding: 8px 12px;
    background-color: rgba(74, 108, 247, 0.05);
    -webkit-border-radius: 6px;
    -moz-border-radius: 6px;
    border-radius: 6px;
    -webkit-transition: background-color 0.2s;
    -moz-transition: background-color 0.2s;
    -o-transition: background-color 0.2s;
    transition: background-color 0.2s;
}

.major-item:hover {
    background-color: rgba(74, 108, 247, 0.1);
}

.major-name {
    font-weight: 600;
    color: var(--heading-color);
}

.major-description {
    display: block;
    font-size: 0.85em;
    color: #555;
}

.additional-info {
    margin-top: 12px;
    padding: 10px;
    background: #f7f7f7;
    border-radius: 5px;
    font-size: 0.9em;
    line-height: 1.5;
}

/* 简单格式内容的样式 */
.simple-content {
    line-height: 1.6;
    color: #333;
    font-size: 0.9rem;
}

.list-item {
    margin: 10px 0;
    padding: 5px 0;
    border-bottom: 1px dashed #eaeaea;
}

.item-number {
    font-weight: bold;
    color: #3498db;
    margin-right: 8px;
}

.item-content {
    color: #333;
}

/* 免责声明和动作按钮 */
.disclaimer {
    margin-top: 25px;
    border-top: 1px solid #eaeaea;
    padding-top: 15px;
    font-size: 0.85em;
    color: #777;
}

.disclaimer i {
    color: #f39c12;
    margin-right: 5px;
}

.result-actions {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 15px;
}

.action-btn {
    padding: 8px 16px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: background 0.2s;
}

.action-btn:hover {
    background: #2980b9;
}

.action-btn i {
    margin-right: 8px;
}

/* 打印样式 */
@media print {
    body * {
        visibility: hidden;
    }
    
    .result-content, .result-content * {
        visibility: visible;
    }
    
    .result-content {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        background: white;
        box-shadow: none;
        max-height: none;
    }
    
    .close-button, .result-actions {
        display: none;
    }
}

/* 响应式调整 */
@media (max-width: 768px) {
    .result-content {
        padding: 15px;
        width: 95%;
    }
    
    .majors-list {
        grid-template-columns: 1fr;
    }
    
    .user-info {
        grid-template-columns: 1fr;
    }
    
    .result-header h2 {
        font-size: 1.4rem;
    }
}

/* AI推荐内容区域的样式 */
.ai-recommendation {
    margin-top: 20px;
    line-height: 1.6;
}

/* 表单组输入动效 */
.form-group input:focus ~ label,
.form-group select:focus ~ label {
    color: var(--primary-color);
}

/* 响应式布局改进 */
@media (min-width: 768px) {
    .container {
        padding: 25px 30px;
    }
}

/* 新增样式 - 应用程序头部 */
.app-header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px dashed #eaeaea;
}

.app-header h1 {
    font-size: 1.7rem;
    margin-bottom: 5px;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-header h1 i {
    margin-right: 8px;
    color: var(--primary-color);
}

.subtitle {
    color: var(--text-color);
    margin-top: -3px;
    font-size: 0.95rem;
    opacity: 0.8;
}

/* 表单卡片样式 */
.form-card {
    background: transparent;
    border-radius: var(--border-radius);
    overflow: hidden;
    margin-bottom: 15px;
}

/* 表单分区样式 */
.form-section {
    background: #fff;
    padding: 13px;
    border-radius: var(--border-radius);
    margin-bottom: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    position: relative;
    border: 1px solid #f0f0f0;
}

.section-title {
    font-weight: 600;
    color: var(--heading-color);
    margin-bottom: 16px;
    font-size: 1rem;
    display: flex;
    align-items: center;
    padding-bottom: 8px;
    border-bottom: 1px solid #f5f5f5;
}

.section-title i {
    margin-right: 8px;
    color: var(--primary-color);
}

.form-section:last-child {
    margin-bottom: 0;
}

/* 单选按钮样式优化 */
.radio-item {
    display: flex;
    align-items: center;
    background-color: #f9f9f9;
    padding: 8px 12px;
    border-radius: var(--border-radius);
    border: 1px solid #f0f0f0;
    transition: all 0.2s ease;
}

.radio-item:hover {
    background-color: #f5f5f5;
}

.radio-label {
    margin-bottom: 0;
    font-weight: normal;
    margin-left: 5px;
}

input[type="radio"] {
    accent-color: var(--primary-color);
    transform: scale(1.1);
}

/* 表单底部说明 */
.form-footer {
    text-align: center;
    margin-top: 15px;
    font-size: 0.85rem;
    color: #888;
    background-color: #f9f9f9;
    padding: 8px 12px;
    border-radius: var(--border-radius);
    border: 1px solid #f0f0f0;
}

/* 响应式调整 */
@media (min-width: 768px) {
    .form-section {
        padding: 13px;
    }
}

/* 添加原因部分的样式 */
.reasons-section {
    margin-top: 20px;
}

.reasons-section h4 {
    color: #2c3e50;
    font-size: 1.15em;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.reasons-section h4 i {
    margin-right: 8px;
    color: #f39c12;
}

.reasons-list {
    list-style: none;
    padding-left: 0;
    margin-bottom: 15px;
}

.reason-item {
    padding: 10px;
    background: #f9f9f9;
    border-radius: 5px;
    margin-bottom: 10px;
    border-left: 3px solid #f39c12;
}

.reason-type {
    font-weight: 600;
    color: var(--primary-color);
    margin-right: 5px;
}

.reason-description {
    color: var(--text-color);
}

.reason-text {
    padding: 10px;
    background: #f9f9f9;
    border-radius: 5px;
    line-height: 1.5;
    color: #555;
}

/* 学校卡片增强 */
.school-card {
    margin-bottom: 30px;
    transition: transform 0.3s, box-shadow 0.3s;
}

.school-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.school-header {
    background: linear-gradient(135deg, #3498db, #2980b9);
    padding: 15px;
}

/* 专业列表增强 */
.majors-list {
    margin-bottom: 15px;
}

.major-item {
    transition: background-color 0.2s;
}

.major-item:hover {
    background-color: #f0f0f0;
}

/* 针对Markdown格式的特殊处理 */
.school-description p {
    margin-bottom: 10px;
}

.school-description ul,
.school-description ol {
    padding-left: 20px;
    margin-bottom: 15px;
}

.school-description li {
    margin-bottom: 5px;
}

/* 打印样式优化 */
@media print {
    .school-card {
        page-break-inside: avoid;
        margin-bottom: 20px;
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .school-header {
        background: #f0f0f0 !important;
        color: #000 !important;
    }
    
    .school-number {
        border: 1px solid #000;
        color: #000 !important;
    }
    
    .major-item,
    .reason-item {
        border-left: 1px solid #aaa;
    }
    
    .majors-section h4 i,
    .reasons-section h4 i,
    .info-label i {
        display: none;
    }
}

/* CSS 重置和兼容性处理 */
* {
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 统一不同浏览器的默认样式 */
html {
    line-height: 1.15;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    font-size: 15px;
}

body {
    font-family: 'Microsoft YaHei', 'Segoe UI', Tahoma, Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: -webkit-linear-gradient(315deg, #f5f7fa 0%, #e0e4f0 100%);
    background: -moz-linear-gradient(315deg, #f5f7fa 0%, #e0e4f0 100%);
    background: -o-linear-gradient(315deg, #f5f7fa 0%, #e0e4f0 100%);
    background: linear-gradient(135deg, #f5f7fa 0%, #e0e4f0 100%);
    padding: 10px;
    min-height: 100vh;
    margin: 0;
    font-size: 0.95rem;
}

/* 添加浏览器前缀以支持更多浏览器 */
.container {
    max-width: 800px;
    margin: 10px auto;
    background: #fff;
    padding: 20px;
    -webkit-border-radius: var(--border-radius);
    -moz-border-radius: var(--border-radius);
    border-radius: var(--border-radius);
    -webkit-box-shadow: var(--card-shadow);
    -moz-box-shadow: var(--card-shadow);
    box-shadow: var(--card-shadow);
    background-image: -webkit-linear-gradient(top, rgba(255, 255, 255, 0.97), rgba(255, 255, 255, 1));
    background-image: -moz-linear-gradient(top, rgba(255, 255, 255, 0.97), rgba(255, 255, 255, 1));
    background-image: -o-linear-gradient(top, rgba(255, 255, 255, 0.97), rgba(255, 255, 255, 1));
    background-image: linear-gradient(to bottom, rgba(255, 255, 255, 0.97), rgba(255, 255, 255, 1));
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* 确保渐变背景在所有浏览器中一致 */
.school-header {
    background: #3498db; /* 回退颜色 */
    background: -webkit-linear-gradient(135deg, #3498db, #2980b9);
    background: -moz-linear-gradient(135deg, #3498db, #2980b9);
    background: linear-gradient(135deg, #3498db, #2980b9);
    padding: 15px;
    color: white;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
}

/* 确保flex布局在所有浏览器中兼容 */
.info-row,
.school-number,
.majors-section h4,
.reasons-section h4 {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
}

/* 确保网格布局兼容性 */
.user-info,
.majors-list {
    display: -ms-grid;
    display: grid;
}

/* 处理IE和旧版Edge的网格布局 */
@supports (-ms-ime-align: auto) {
    .user-info {
        display: -webkit-box;
        display: -ms-flexbox;
        display: flex;
        -ms-flex-wrap: wrap;
        flex-wrap: wrap;
    }
    
    .info-row {
        width: 100%;
        margin-bottom: 5px;
    }
    
    .majors-list {
        display: -webkit-box;
        display: -ms-flexbox;
        display: flex;
        -ms-flex-wrap: wrap;
        flex-wrap: wrap;
    }
    
    .major-item {
        width: calc(50% - 10px);
        margin-right: 10px;
        margin-bottom: 10px;
    }
}

/* 确保动画效果在所有浏览器中一致 */
@-webkit-keyframes spin {
    0% { -webkit-transform: rotate(0deg); transform: rotate(0deg); }
    100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); }
}

@keyframes spin {
    0% { -webkit-transform: rotate(0deg); transform: rotate(0deg); }
    100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); }
}

/* 修复Safari中的一些特殊问题 */
@media not all and (min-resolution:.001dpcm) { 
    @supports (-webkit-appearance:none) {
        .school-card,
        .major-item,
        .reason-item {
            -webkit-transform: translateZ(0); /* 修复Safari中的渲染问题 */
        }
        
        .result-modal {
            -webkit-backdrop-filter: blur(3px); /* Safari的模糊效果需要特殊处理 */
        }
    }
}

/* 确保IE11中的弹性盒子正确工作 */
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
    .school-header,
    .info-row,
    .result-actions {
        display: block;
    }
    
    .school-number {
        display: inline-block;
        vertical-align: middle;
    }
    
    .school-name {
        display: inline-block;
        vertical-align: middle;
        margin-left: 12px;
    }
    
    .info-label,
    .info-value {
        display: inline-block;
        vertical-align: middle;
    }
    
    .action-btn {
        display: inline-block;
        margin-right: 15px;
    }
}

/* 确保表单在所有浏览器中一致 */
button, 
input, 
select {
    font-family: inherit;
    font-size: 100%;
    line-height: 1.15;
    margin: 0;
}

button,
select {
    text-transform: none;
}

button {
    -webkit-appearance: button;
    -moz-appearance: button;
    appearance: button;
    overflow: visible;
}

/* 添加浏览器兼容性处理 */
/* IE 10-11 特定修复 */
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
    body {
        background: #f5f7fa;
    }
    
    .container {
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
        background: #fff;
    }
    
    .school-card {
        border: 1px solid #eee;
        margin-bottom: 20px;
    }
    
    .school-header {
        background: #f5f7fa;
    }
    
    .result-modal {
        background-color: rgba(0, 0, 0, 0.5);
    }
}

/* Safari 特定修复 */
@media not all and (min-resolution:.001dpcm) { 
    @supports (-webkit-appearance:none) {
        .school-card,
        .result-container,
        button,
        select,
        input[type="number"] {
            -webkit-transform: translateZ(0);
        }
        
        .result-modal {
            -webkit-backdrop-filter: blur(3px);
        }
    }
}

/* 修复Markdown格式化问题 */
.school-name {
    -webkit-hyphens: auto;
    -moz-hyphens: auto;
    -ms-hyphens: auto;
    hyphens: auto;
    word-wrap: break-word;
    word-break: break-word;
}

.major-item,
.reason-item {
    position: relative;
    padding-left: 20px;
}

.major-item:before,
.reason-item:before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--primary-color);
}

/* 添加不同浏览器的动画兼容性 */
@-webkit-keyframes spin {
    0% { -webkit-transform: rotate(0deg); }
    100% { -webkit-transform: rotate(360deg); }
}

@-moz-keyframes spin {
    0% { -moz-transform: rotate(0deg); }
    100% { -moz-transform: rotate(360deg); }
}

@-o-keyframes spin {
    0% { -o-transform: rotate(0deg); }
    100% { -o-transform: rotate(360deg); }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(74, 108, 247, 0.2);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    margin: 0 auto 20px;
    -webkit-animation: spin 1s linear infinite;
    -moz-animation: spin 1s linear infinite;
    -o-animation: spin 1s linear infinite;
    animation: spin 1s linear infinite;
}

/* 改进学校卡片样式 */
.school-card {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.05);
    -webkit-border-radius: 8px;
    -moz-border-radius: 8px;
    border-radius: 8px;
    margin-bottom: 20px;
    -webkit-box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
    -moz-box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
    -webkit-transition: box-shadow 0.3s, transform 0.3s;
    -moz-transition: box-shadow 0.3s, transform 0.3s;
    -o-transition: box-shadow 0.3s, transform 0.3s;
    transition: box-shadow 0.3s, transform 0.3s;
    overflow: hidden;
}

.school-card:hover {
    -webkit-box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    -moz-box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    -webkit-transform: translateY(-2px);
    -moz-transform: translateY(-2px);
    -ms-transform: translateY(-2px);
    -o-transform: translateY(-2px);
    transform: translateY(-2px);
}

/* 改进Markdown格式内容显示 */
.ai-recommendation {
    margin-top: 20px;
    line-height: 1.6;
}

.majors-list,
.reasons-list {
    list-style: none;
    padding-left: 0;
    margin-bottom: 15px;
}

.major-item {
    margin-bottom: 8px;
    padding: 8px 12px;
    background-color: rgba(74, 108, 247, 0.05);
    -webkit-border-radius: 6px;
    -moz-border-radius: 6px;
    border-radius: 6px;
    -webkit-transition: background-color 0.2s;
    -moz-transition: background-color 0.2s;
    -o-transition: background-color 0.2s;
    transition: background-color 0.2s;
}

.major-item:hover {
    background-color: rgba(74, 108, 247, 0.1);
}

.major-name {
    font-weight: 600;
    color: var(--heading-color);
}

.reason-type {
    font-weight: 600;
    color: var(--primary-color);
    margin-right: 5px;
}

.reason-description {
    color: var(--text-color);
}

/* 添加Markdown内容样式 */
.markdown-content {
    font-family: 'Microsoft YaHei', 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: #333;
    padding: 20px;
}

.markdown-content h3 {
    color: #1a73e8;
    margin-top: 25px;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eaeaea;
    font-size: 18px;
    font-weight: 600;
}

.markdown-content h3:first-child {
    margin-top: 5px;
}

.markdown-content p {
    margin-bottom: 15px;
    line-height: 1.7;
}

.markdown-content ul {
    padding-left: 20px;
    margin-bottom: 20px;
    list-style-type: disc;
}

.markdown-content li {
    margin-bottom: 8px;
    line-height: 1.5;
}

/* 专业名称加粗样式 */
.markdown-content strong, 
.markdown-content b {
    font-weight: 600;
    color: #333;
}

/* 分隔符样式 */
.markdown-content hr {
    border: 0;
    border-top: 1px solid #eaeaea;
    margin: 20px 0;
}

/* 确保弹窗内容可见 */
.result-modal.active .result-content {
    transform: scale(1);
    opacity: 1;
    overflow: visible;
}

/* 后备内容样式 */
.fallback-content {
    font-family: 'Microsoft YaHei', 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: #333;
    padding: 15px;
    white-space: pre-wrap;
    background-color: #f9f9f9;
    border-radius: 8px;
    margin-top: 10px;
}

/* 模型标识样式 */
.model-badge {
    display: inline-flex;
    align-items: center;
    transition: all 0.3s ease;
}

.model-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.model-badge::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: #52c41a;
    border-radius: 50%;
    margin-right: 6px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(82, 196, 26, 0.4);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(82, 196, 26, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(82, 196, 26, 0);
    }
}

/* 结果内容中的专业名称加粗 */
.markdown-content strong, 
.markdown-content b {
    font-weight: 600;
    color: #333;
}

/* 优化结果弹窗整体样式 */
.result-modal .result-content {
    max-width: 800px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.result-modal .result-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #eaeaea;
    padding: 15px 20px;
    border-radius: 12px 12px 0 0;
}

.result-modal .result-header h2 {
    font-size: 20px;
    color: #333;
    margin: 0;
}

#modalResult {
    padding: 20px;
    max-height: 70vh;
    overflow-y: auto;
}

/* 美化关闭按钮 */
.close-button {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #f0f0f0;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 20px;
    line-height: 30px;
    padding: 0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.close-button:hover {
    background: #e0e0e0;
    transform: rotate(90deg);
}

/* 排名信息样式 */
.info-value .rank-percent {
    font-size: 0.9em;
    color: #6c757d;
    margin-left: 5px;
}

.info-value .subject-type {
    font-size: 0.85em;
    background-color: #f1f8ff;
    color: #0366d6;
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 8px;
    border: 1px solid #d1e8ff;
}

.info-value .total-candidates {
    font-size: 0.85em;
    color: #6c757d;
    margin-left: 5px;
}

/* 用户信息样式增强 */
.user-info {
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.info-row {
    display: flex;
    margin-bottom: 10px;
    align-items: center;
}

.info-row:last-child {
    margin-bottom: 0;
}

.info-label {
    width: 30%;
    font-weight: 500;
    color: #495057;
}

.info-value {
    width: 70%;
    font-weight: 600;
}

.info-value.highlight {
    color: #2c7be5;
    font-size: 1.1em;
} 