/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #e0e0e0;
    background-color: #121212;
    background-image: linear-gradient(135deg, #121212 0%, #1e1e1e 100%);
}

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

/* 头部样式 */
header {
    background-color: rgba(18, 18, 18, 0.95);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    position: relative; /* 改为相对定位，不再固定在顶部 */
    z-index: 1000;
}

nav {
    display: flex;
    justify-content: center;
    padding: 0.8rem 0;
}

nav .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: #ff6b6b;
    text-shadow: 0 0 10px rgba(255, 107, 107, 0.3);
    margin-bottom: 0.5rem;
    text-align: center;
}

.nav-links {
    display: flex;
    list-style: none;
    justify-content: center;
    width: 100%;
}

.nav-links li {
    margin: 0 1.5rem;
}

.nav-links a {
    color: #e0e0e0;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: #ff6b6b;
    transition: width 0.3s ease;
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

.nav-links a:hover,
.nav-links a.active {
    color: #ff6b6b;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn-primary {
    background-color: #ff6b6b;
    color: #fff;
}

.btn-primary:hover {
    background-color: #ff5252;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

.btn-secondary {
    background-color: #424242;
    color: #fff;
}

.btn-secondary:hover {
    background-color: #616161;
    transform: translateY(-2px);
}

.btn-success {
    background-color: #4caf50;
    color: #fff;
}

.btn-success:hover {
    background-color: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 英雄区域 */
.hero {
    text-align: center;
    padding: 6rem 0;
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.1) 0%, rgba(103, 58, 183, 0.1) 100%);
    margin-bottom: 3rem;
}

.hero h2 {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #fff;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    color: #bdbdbd;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* 介绍区域 */
.intro {
    padding: 3rem 0;
    margin-bottom: 3rem;
}

.intro h3 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
    color: #ff6b6b;
}

.dark-triad {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.trait {
    background-color: rgba(30, 30, 30, 0.8);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 107, 107, 0.1);
}

.trait:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 107, 107, 0.3);
}

.trait h4 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #ff6b6b;
}

.trait p {
    color: #bdbdbd;
    line-height: 1.7;
}

/* 目的区域 */
.purpose {
    padding: 3rem 0;
    background-color: rgba(30, 30, 30, 0.5);
    border-radius: 15px;
    margin-bottom: 3rem;
}

.purpose h3 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
    color: #ff6b6b;
}

.purpose p {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 1rem;
    color: #bdbdbd;
    line-height: 1.7;
}

/* 测试页面 */
.test-section {
    padding: 1rem 0 3rem;
    min-height: 100vh;
    box-sizing: border-box;
    margin-top: 0; /* 移除固定头部的预留空间 */
}

.test-header {
    text-align: center;
    margin-bottom: 2rem;
}

.test-header h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #ff6b6b;
}

.progress-container {
    margin-top: 2rem;
}

.progress-bar {
    width: 100%;
    height: 10px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress {
    height: 100%;
    background: linear-gradient(90deg, #ff6b6b 0%, #673ab7 100%);
    border-radius: 5px;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(255, 107, 107, 0.5);
}

.progress-text {
    font-size: 0.9rem;
    color: #bdbdbd;
    font-weight: 500;
}

.test-content {
    background-color: rgba(30, 30, 30, 0.9);
    padding: 1.5rem 2rem;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255, 107, 107, 0.1);
    min-height: 500px;
    max-height: none;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, rgba(30, 30, 30, 0.95) 0%, rgba(40, 40, 40, 0.95) 100%);
    overflow: visible;
}

.question {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100%;
    overflow: visible;
}

.question h3 {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    color: #fff;
    line-height: 1.4;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid rgba(255, 107, 107, 0.2);
}

.options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1;
    margin: 1rem 0 0;
    overflow: visible;
    min-height: auto;
}

.option {
    display: flex;
    align-items: center;
    padding: 1.2rem 1.5rem;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    min-height: 55px;
    background: linear-gradient(135deg, rgba(40, 40, 40, 0.6) 0%, rgba(50, 50, 50, 0.6) 100%);
    position: relative;
    z-index: 1;
}

.option:hover {
    background-color: rgba(255, 107, 107, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.option.selected {
    background-color: rgba(255, 107, 107, 0.25);
    border-color: #ff6b6b;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
    z-index: 2;
}

.option input[type="radio"] {
    margin-right: 1.2rem;
    width: 22px;
    height: 22px;
    accent-color: #ff6b6b;
    flex-shrink: 0;
    cursor: pointer;
}

.option label {
    cursor: pointer;
    font-size: 1.1rem;
    color: #e0e0e0;
    flex: 1;
    line-height: 1.5;
}

.test-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    gap: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* 结果页面 */
.results-section {
    padding: 3rem 0;
}

.results-header {
    text-align: center;
    margin-bottom: 3rem;
}

.results-header h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #ff6b6b;
}

.results-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.result-card {
    background-color: rgba(30, 30, 30, 0.8);
    padding: 2.5rem;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 107, 107, 0.1);
}

.result-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.4);
}

.result-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #ff6b6b;
}

.score {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #fff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.description {
    margin-top: 1rem;
    color: #bdbdbd;
    line-height: 1.7;
}

.result-summary {
    background-color: rgba(30, 30, 30, 0.8);
    padding: 2.5rem;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 107, 107, 0.1);
}

.result-summary h3 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: #ff6b6b;
    text-align: center;
}

.result-summary p {
    margin-bottom: 1rem;
    color: #bdbdbd;
    line-height: 1.7;
}

.action-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

/* 关于页面 */
.about-section {
    padding: 3rem 0;
}

.about-section h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: #ff6b6b;
}

.about-content {
    background-color: rgba(30, 30, 30, 0.8);
    padding: 3rem;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 107, 107, 0.1);
}

.about-content h3 {
    font-size: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #ff6b6b;
}

.about-content p {
    margin-bottom: 1rem;
    color: #bdbdbd;
    line-height: 1.7;
}

.about-content ul {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.about-content li {
    margin-bottom: 0.5rem;
    color: #bdbdbd;
    line-height: 1.7;
}

/* 页脚 */
footer {
    background-color: rgba(18, 18, 18, 0.95);
    padding: 2rem 0;
    text-align: center;
    margin-top: 3rem;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
}

footer p {
    color: #757575;
    font-size: 0.9rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    /* 手机端头部优化 */
    header {
        padding: 0.5rem 0;
    }

    nav {
        padding: 0.5rem 0;
        flex-direction: column;
        gap: 0.3rem;
    }

    .logo {
        font-size: 1.4rem;
        margin-bottom: 0.3rem;
    }

    .nav-links {
        flex-direction: row;
        flex-wrap: nowrap;
        justify-content: center;
        margin-top: 0;
    }

    .nav-links li {
        margin: 0 0.8rem;
    }

    .nav-links a {
        font-size: 0.85rem;
        padding: 0.3rem 0;
    }

    /* 手机端内容优化 */
    .hero {
        padding: 4rem 0 3rem;
    }

    .hero h2 {
        font-size: 1.8rem;
    }

    .hero p {
        font-size: 1rem;
    }

    /* 测试页面手机端优化 */
    .test-section {
        padding: 1rem 0 2rem;
        margin: 0;
    }

    .test-header {
        margin-bottom: 1.5rem;
    }

    .test-content {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
        min-height: 400px;
        max-height: calc(100vh - 200px);
        overflow-y: auto;
        scrollbar-width: thin;
        scrollbar-color: rgba(255, 107, 107, 0.5) transparent;
    }

    .question h3 {
        font-size: 1.2rem;
        margin-bottom: 1.5rem;
        line-height: 1.5;
        padding-bottom: 1rem;
        border-bottom: 1px solid rgba(255, 107, 107, 0.2);
    }

    .options {
        gap: 0.8rem;
        margin: 0.5rem 0;
    }

    .option {
        padding: 1.2rem;
        min-height: auto;
        max-height: none;
        flex-direction: row;
        align-items: center;
    }

    .option label {
        font-size: 0.95rem;
        line-height: 1.4;
    }

    .option input[type="radio"] {
        margin-right: 1rem;
        width: 20px;
        height: 20px;
    }

    .test-navigation {
        flex-direction: column;
        gap: 0.8rem;
        padding: 1.2rem 0 0;
        margin-top: 1rem;
    }

    .test-navigation .btn {
        width: 100%;
        padding: 1rem;
        font-size: 1rem;
        font-weight: 600;
    }

    /* 进度条手机端优化 */
    .progress-container {
        margin-top: 0;
    }

    .progress-bar {
        height: 8px;
        margin-bottom: 0.3rem;
    }

    .progress-text {
        font-size: 0.85rem;
    }

    /* 其他页面响应式优化 */
    .dark-triad {
        grid-template-columns: 1fr;
    }

    .result-card {
        padding: 2rem 1rem;
    }

    .result-summary {
        padding: 2rem 1rem;
    }

    .about-content {
        padding: 2rem 1rem;
    }

    .action-buttons {
        flex-direction: column;
        align-items: center;
    }

    .action-buttons .btn {
        width: 100%;
        text-align: center;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero,
.intro,
.purpose,
.test-section,
.results-section,
.about-section {
    animation: fadeIn 0.8s ease-out;
}

.trait,
.option,
.result-card,
.result-summary,
.about-content {
    animation: fadeIn 0.6s ease-out;
}

/* 平滑滚动 */
html {
    scroll-behavior: smooth;
}