/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
}

body {
    background-color: #4298B3; /* 新的背景颜色 */
    color: #333;
    line-height: 1.6;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 标题部分 */
.header {
    text-align: center;
    margin-bottom: 40px;
    padding-top: 30px;
}

/* 更新为官网样式 - logo容器 */
.logo-container {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

/* 添加白色圆角矩形背景 */
.logo-container {
    background-color: white;
    width: fit-content;
    margin: 0 auto 20px;
    border-radius: 40px;
    padding: 10px 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.logo-full {
    height: auto;
    max-width: 460px; /* 调整宽度以匹配官网 */
}

.subtitle {
    color: white;
    font-size: 18px;
    max-width: 800px;
    margin: 15px auto 0;
}

/* 测试选项卡 */
.test-options {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 30px;
    margin: 30px auto 40px;
    max-width: 1160px;
}

/* 移动端布局特别处理 */
.test-options.mobile-layout {
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 0;
}

/* 移动端布局特别处理下的卡片样式 */
.test-options.mobile-layout .test-card {
    width: 85%;
    max-width: 280px;
    height: auto;
    min-height: 160px;
    box-shadow: none;
    margin-bottom: 20px;
    background-color: white;
    border-radius: 0;
}

.test-options.mobile-layout .card-image {
    height: 190px;
    padding: 20px;
    margin: 10px 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.test-options.mobile-layout .card-image img {
    max-height: 120px;
    max-width: 100%;
    width: auto;
    object-fit: contain;
}

.test-options.mobile-layout .label {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 7px 15px;
    font-size: 14px;
    border-radius: 30px;
    margin-top: 0;
    white-space: nowrap;
    font-weight: 500;
    z-index: 10;
}

.test-options.mobile-layout .card-title-box {
    padding: 0;
    margin: 0 auto;
    width: 100%;
    max-width: 100%;
    border: none;
    background: transparent;
    box-shadow: none;
    display: block;
    text-align: center;
}

.test-options.mobile-layout .test-card h2 {
    font-size: 32px;
    margin: 0;
    line-height: 1.2;
    display: block;
    text-align: center;
    font-weight: 700;
    color: #333;
}

.test-options.mobile-layout .test-card p {
    font-size: 18px;
    margin: 5px 0 0 0;
    display: block;
    text-align: center;
    color: #555;
}

/* 测试卡片 */
.test-card {
    background-color: white;
    border-radius: 0; /* 移除圆角 */
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    width: 320px;
    height: 470px; /* 调整为更短的高度 */
    position: relative;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
}

.test-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* 选中状态样式 */
.test-card.selected {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.test-card.selected::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 3px solid #b2279a;
    border-radius: 0; /* 移除圆角 */
    pointer-events: none;
}

.label {
    background-color: #2b9d08; /* 调整为更准确的绿色 */
    color: white;
    font-size: 16px; /* 增加字体大小 */
    padding: 10px 25px; /* 增加内边距 */
    position: absolute;
    top: 0;
    left: 50%; /* 居中放置 */
    transform: translateX(-50%); /* 水平居中 */
    border-radius: 30px; /* 更圆润的边角 */
    font-weight: 600;
    z-index: 1;
    margin-top: 20px; /* 向上偏移，使标签位于卡片顶部 */
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.test-card.professional .label {
    background-color: #089D3D; /* 统一使用相同的绿色 */
}

.test-card.complete .label {
    background-color: #089D3D; /* 统一使用相同的绿色 */
}

/* 卡片内容 */
.card-content {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    padding: 40px 25px 20px; /* 为顶部标签留出空间，并保留原有内边距 */
}

/* 卡片图片 */
.card-image {
    text-align: center;
    padding: 15px;
    height: auto; 
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    max-height: 280px; /* 限制图片高度 */
    margin-bottom: 15px; /* 为底部标题框留出空间 */
}

.card-image img {
    max-width: 100%;
    max-height: 220px; /* 限制图片高度 */
    width: auto;
    height: auto;
    object-fit: contain;
}

/* 卡片文本区域样式 */
.card-text {
    margin-top: auto; /* 将文本区域推到底部 */
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 140px; /* 确保足够的高度 */
    width: 100%;
}

/* 移动端文本区域特殊处理 */
.test-options.mobile-layout .card-text {
    min-height: auto;
    margin-top: 0;
}

/* 新增卡片标题盒子样式 - 完善 */
.card-title-box {
    text-align: center;
   
    padding: 18px 30px;
    margin: 10px auto 20px;
    border-radius: 10px;
    width: 70%;
    max-width: 220px;
    box-sizing: border-box;
    background-color: #ffffff;

}

.test-card h2 {
    font-size: 40px; /* 增加字号 */
    font-weight: 700;
    margin-bottom: 0;
    color: #333;
    line-height: 1.1;
}

.test-card p {
    color: #666;
    font-size: 20px; /* 增加字体大小 */
    margin-top: 5px;
    margin-bottom: 0;
    font-weight: 500;
}

/* 测试按钮 */
.test-button-container {
    text-align: center;
    margin: 30px 0 20px; /* 调整上下边距更贴近官网 */
}

.start-test-button {
    background-color: #b2279a; /* 官网的紫红色 */
    color: white;
    border: none;
    padding: 15px 40px; /* 调整内边距使按钮大小更准确 */
    font-size: 18px;
    border-radius: 8px; /* 增加圆角 */
    cursor: pointer;
    font-weight: 500;
    box-shadow: 0 4px 8px rgba(178, 39, 154, 0.3);
}

@media (max-width: 480px) {
    .start-test-button {
        padding: 15px 0;
        width: 70%;
        max-width: 300px;
        border-radius: 8px;
        font-size: 18px;
        box-shadow: none;
        margin: 20px auto;
    }
}

.start-test-button:hover {
    background-color: #9c1f87;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(178, 39, 154, 0.4);
}

.description {
    text-align: center;
    color: white;
    font-size: 16px;
    margin-bottom: 30px; /* 减少底部边距 */
}

/* 解析部分 - 标题区域独立 */
.personality-title-section {
    background-color: white;
    padding: 40px 20px;
    border-radius: 0;
    margin: 60px auto 25px;
    box-shadow: none;
    max-width: 1160px;
    width: calc(100% - 40px);
    border: 1px solid #eaeaea;
}

.section-title {
    text-align: center;
    font-size: 36px;
    margin-bottom: 15px;
    color: #333;
    font-weight: 700;
}

.section-subtitle {
    text-align: center;
    color: #666;
    font-size: 16px;
    margin-bottom: 0;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.5;
}

/* 人格卡片网格 */
.personality-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    max-width: 1160px;
    width: calc(100% - 40px);
    margin: 0 auto 40px;
}

.personality-card {
    background-color: white;
    overflow: hidden;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    height: 100%;
    border: 1px solid #eaeaea;
}

.personality-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

/* 卡片顶部颜色条 */
.color-bar {
    height: 8px;
}

.intj-color { background-color: #4ece98; }
.intp-color { background-color: #6e7ee5; }
.entj-color { background-color: #f06e5a; }
.entp-color { background-color: #f9b846; }
.infj-color { background-color: #8e71c6; }
.infp-color { background-color: #8e71c6; }
.enfj-color { background-color: #f06e5a; }
.enfp-color { background-color: #f9b846; }
.istj-color { background-color: #4ece98; }
.isfj-color { background-color: #4ece98; }
.estj-color { background-color: #f06e5a; }
.esfj-color { background-color: #f06e5a; }
.istp-color { background-color: #4ece98; }
.isfp-color { background-color: #4ece98; }
.estp-color { background-color: #f06e5a; }
.esfp-color { background-color: #f06e5a; }

.personality-card h3 {
    font-size: 32px;
    margin-bottom: 2px;
    font-weight: 700;
    letter-spacing: 0px;
    color: #333;
    text-align: center;
}

.personality-card h4 {
    color: #666;
    font-size: 20px;
    margin-bottom: 20px;
    font-weight: 500;
    text-align: center;
}

.personality-card p {
    font-size: 14px;
    color: #555;
    margin: 0;
    flex-grow: 1;
    line-height: 1.6;
    text-align: left;
}

/* 底部部分 */
.bottom-section {
    text-align: center;
    margin: 40px auto 30px;
    background-color: #f5f7f1;
    padding: 40px 20px;
    border-radius: 0;
    border: 1px solid #eaeaea;
    max-width: 1160px;
    width: calc(100% - 40px);
    box-shadow: none;
}

.bottom-title {
    font-size: 26px;
    margin-bottom: 25px;
    font-weight: 600;
    color: #333;
}

.start-test-button.secondary {
    background-color: #4cbb61;
    box-shadow: none;
    border-radius: 30px;
    padding: 12px 36px;
    font-size: 18px;
    font-weight: 500;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.start-test-button.secondary:hover {
    background-color: #419e53;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(76, 187, 97, 0.3);
}

/* 页脚 */
footer {
    text-align: center;
    color: white;
    font-size: 14px;
    margin-top: 0;
    padding: 35px 0;
    background-color: #212121;
    width: 100%;
    box-sizing: border-box;
   
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .personality-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .logo-container {
        padding: 8px 16px;
    }
    
    .logo-full {
        max-width: 380px;
    }
    
    .test-card {
        width: 300px;
        height: 450px;
    }
    
    .card-image {
        max-height: 240px;
    }
    
    .card-text {
        min-height: 130px;
    }
    
    .section-title {
        font-size: 30px;
    }
    
    .start-test-button {
        padding: 14px 35px;
    }
    
    .personality-card h3 {
        font-size: 30px;
    }
    
    .personality-card h4 {
        font-size: 18px;
        margin-bottom: 15px;
    }
    
    .card-content {
        padding: 20px;
    }
    
    .card-title-box {
        padding: 15px 25px;
        max-width: 210px;
        border-width: 3px;
    }
    
    .test-card h2 {
        font-size: 36px;
    }
}

@media (max-width: 768px) {
    .personality-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        margin-top: 15px;
    }
    
    .test-options {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    
    .test-card {
        width: 85%;
        max-width: 320px;
        height: auto;
        min-height: 220px;
        margin-bottom: 15px;
    }
    
    .logo-container {
        width: 80%;
        max-width: 300px;
        padding: 8px 15px;
    }
    
    .logo-full {
        max-width: 100%;
    }
    
    .label {
        font-size: 14px;
        padding: 8px 20px;
        margin-top: 15px;
    }
    
    .test-card h2 {
        font-size: 34px;
    }
    
    .test-card p {
        font-size: 18px;
    }
    
    .section-title {
        font-size: 24px;
    }
    
    .personality-title-section {
        padding: 30px 15px;
        margin: 40px auto 20px;
    }
    
    .personality-card h3 {
        font-size: 22px;
    }
    
    .personality-card h4 {
        font-size: 16px;
    }
    
    .bottom-section {
        padding: 30px 15px;
    }
    
    .bottom-title {
        font-size: 22px;
    }
    
    .start-test-button.secondary {
        padding: 12px 30px;
    }
    
    .card-text {
        min-height: 110px;
    }
    
    .card-title-box {
        padding: 12px 20px;
        width: 80%;
    }
    
    /* 修改卡片图片容器高度 */
    .card-image {
        max-height: 120px;
        margin-bottom: 10px;
        padding: 10px;
    }
    
    /* 修改卡片图片大小 */
    .card-image img {
        max-height: 100px;
    }
    
    /* 卡片内容内边距 */
    .card-content {
        padding: 35px 15px 15px;
    }
}

@media (max-width: 480px) {
    .personality-grid {
        grid-template-columns: 1fr;
        margin-top: 10px;
    }
    
    .subtitle {
        font-size: 16px;
        padding: 0 15px;
    }
    
    /* 更新移动端测试选项布局 - 改为横向排列 */
    .test-options {
        flex-direction: row;
        justify-content: center;
        flex-wrap: nowrap;
        align-items: stretch;
        gap: 0;
        margin: 25px auto;
        padding: 0;
        width: 100%;
    }
    
    /* 卡片内容调整 */
    .card-content {
        padding: 30px 5px 10px;
    }
    
    .card-text {
        padding: 0;
        min-height: auto;
        text-align: center;
        margin-top: 0;
    }
    
    /* 移动端特殊调整 */
    .test-options.mobile-layout .card-content {
        padding: 60px 10px 20px;
        height: 100%;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }
    
    .test-options.mobile-layout .card-text {
        margin-top: auto;
        padding-bottom: 20px;
    }
    
    /* 移动端卡片样式调整，以匹配官网 */
    .test-card {
        width: 31%;
        height: 350px;
        margin: 0 3px;
        box-shadow: none;
        border-radius: 0;
        background-color: white;
        overflow: visible;
        border-radius: 8px;
    }
    
    /* 专门处理标准版卡片样式，使其与官网一致 */
    .test-card.standard {
        margin-bottom: 0;
    }
    
    /* 卡片内容布局调整 */
    .card-content {
        padding: 35px 10px 10px;
        justify-content: flex-start;
        display: flex;
        flex-direction: column;
    }
    
    /* 标签样式调整 */
    .label {
        font-size: 12px;
        padding: 6px 15px;
        margin-top: 10px;
        border-radius: 20px;
    }
    
    /* 图片容器高度调整，使其与官网一致 */
    .card-image {
        max-height: 100px;
        padding: 5px;
        margin-bottom: 5px;
    }
    
    /* 图片大小调整 */
    .card-image img {
        max-height: 80px;
    }
    
    /* 文本区域调整 */
    .card-text {
        min-height: 90px;
    }
    
    /* 标题框调整 */
    .card-title-box {
        padding: 10px 15px;
        margin: 5px auto 10px;
        width: 80%;
        max-width: 180px;
        border-width: 2px;
    }
    
    /* 卡片标题字体大小调整 */
    .test-card h2 {
        font-size: 28px;
    }
    
    /* 卡片副标题字体大小调整 */
    .test-card p {
        font-size: 16px;
        margin-top: 2px;
    }
    
    /* 容器内边距调整 */
    .container {
        padding: 15px 10px;
    }
    
    /* 标题区域外边距调整 */
    .header {
        margin-bottom: 20px;
        padding-top: 15px;
    }
    
    /* logo容器宽度调整 */
    .logo-container {
        width: 90%;
        max-width: 260px;
        padding: 6px 12px;
    }
    
    /* logo大小调整 */
    .logo-full {
        max-width: 100%;
    }
    
    /* 段落标题字体大小调整 */
    .section-title {
        font-size: 20px;
    }
    
    /* 段落副标题字体大小调整 */
    .section-subtitle {
        font-size: 14px;
    }
    
    /* 描述文字字体大小调整 */
    .description {
        font-size: 14px;
        margin: 15px auto 25px;
        width: 85%;
        text-align: center;
        line-height: 1.5;
    }
    
    /* 人格部分标题区域内边距调整 */
    .personality-title-section {
        padding: 25px 10px;
        margin: 30px auto 15px;
    }
    
    /* 人格卡片标题字体大小调整 */
    .personality-card h3 {
        font-size: 20px;
    }
    
    /* 人格卡片副标题字体大小调整 */
    .personality-card h4 {
        font-size: 15px;
    }
    
    /* 底部区域内边距调整 */
    .bottom-section {
        padding: 25px 10px;
    }
    
    /* 底部标题字体大小调整 */
    .bottom-title {
        font-size: 20px;
    }
    
    /* 次要测试按钮大小调整 */
    .start-test-button.secondary {
        padding: 10px 25px;
        font-size: 16px;
    }
    
    /* 主要测试按钮大小调整 */
    .start-test-button {
        padding: 15px 30px;
        font-size: 16px;
        width: 65%;
        max-width: 260px;
        background-color: #b2279a;
        color: white;
        border-radius: 8px;
        box-shadow: none;
        font-weight: normal;
    }
    
    /* 按钮容器外边距调整 */
    .test-button-container {
        margin: 20px 0 15px;
    }
    
    /* 修改移动端下的测试卡片布局 */
    .test-options {
        flex-direction: column;
        align-items: center;
        gap: 20px;
        margin: 20px auto;
    }
    
    /* 确保卡片占据适当宽度 */
    .test-card {
        width: 85%;
        max-width: 280px;
        margin-bottom: 20px;
        box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    }
}