:root {
    --primary-color: #8e24aa; /* 更深的紫色 */
    --primary-light: #e1bee7;
    --primary-dark: #4a148c; /* 更深的深紫色 */
    --bg-color: #f3e5f5;
    --text-color: #333;
    --text-light: #666;
    --white: #ffffff;
    --shadow: 0 4px 12px rgba(142, 36, 170, 0.2);
    --radius: 16px;
}

/* Male Theme Colors */
body.theme-male {
    --primary-color: #1e88e5; /* Blue */
    --primary-light: #bbdefb;
    --primary-dark: #1565c0;
    --bg-color: #e3f2fd;
    background-image: linear-gradient(135deg, #e3f2fd 0%, #90caf9 100%);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    background-image: linear-gradient(135deg, #f3e5f5 0%, #ce93d8 100%); /* 背景渐变也稍微加深一点 */
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    position: relative;
}

.app-container {
    width: 100%;
    max-width: 480px; /* Mobile max width */
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    min-height: 100vh;
    position: relative;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.05);
}

/* Privacy Header */
/* Removed */

/* Views */
.view {
    display: none;
    padding: 40px 20px 40px;
    min-height: 100vh;
    animation: fadeIn 0.4s ease-out;
}

.view.active {
    display: block;
}

/* 答题页特殊处理 */
#quiz-view {
    padding-top: 80px; /* 为固定头部留空间 */
    padding-bottom: 40px;
}

#quiz-view .content-wrapper {
    padding-top: 0;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        margin-top: 20px;
    }
    to {
        opacity: 1;
        margin-top: 0;
    }
}

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

/* Typography */
.title-group {
    margin-bottom: 50px;
    position: relative;
    z-index: 2;
}

.main-title {
    font-size: 32px;
    color: var(--primary-dark);
    margin-bottom: 12px;
    text-align: center;
    font-weight: 800;
    letter-spacing: 2px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.sub-title {
    font-size: 16px;
    color: var(--text-light);
    text-align: center;
    font-weight: 500;
    opacity: 0.8;
    padding-top: 20px;
}

/* Home Decor */
.home-decor {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.decor-heart {
    position: absolute;
    color: rgba(255, 255, 255, 0.6); /* 增加不透明度 */
    animation: float 8s ease-in-out infinite;
    filter: drop-shadow(0 4px 8px rgba(142, 36, 170, 0.2));
}

.heart-1 {
    width: 120px; /* 增大 */
    top: 10%;
    left: -30px;
    transform: rotate(-15deg);
    animation-duration: 7s;
}

.heart-2 {
    width: 90px;
    bottom: 25%;
    right: -15px;
    transform: rotate(15deg);
    animation-delay: 2s;
    animation-duration: 9s;
}

.heart-3 {
    width: 70px;
    top: 55%;
    left: 10%;
    transform: rotate(10deg);
    animation-delay: 1s;
    animation-duration: 6s;
    opacity: 0.7;
}

@keyframes float {
    0%,
    100% {
        transform: translateY(0) rotate(var(--r, 0deg));
    }
    50% {
        transform: translateY(-25px) rotate(calc(var(--r, 0deg) + 5deg));
    }
}

.section-title {
    font-size: 24px;
    color: var(--primary-dark);
    margin-bottom: 8px;
}

.section-desc {
    font-size: 16px;
    color: var(--text-light);
    padding-top: 20px;
    margin-bottom: 40px;
    text-align: center;
    font-weight: 500;
    opacity: 0.8;
}

/* Buttons & Cards */
.gender-selection {
    display: flex;
    gap: 25px;
    width: 100%;
    justify-content: center;
    position: relative;
    z-index: 2;
}

.gender-btn {
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid transparent;
    border-radius: 24px;
    padding: 25px 15px;
    width: 130px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.gender-btn:active {
    transform: scale(0.95);
}

.gender-btn.male {
    color: #5c6bc0;
}
.gender-btn.female {
    color: #ec407a;
}

.icon-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: bold;
    transition: all 0.3s;
}

.gender-btn.male .icon-circle {
    background: #e8eaf6;
}
.gender-btn.female .icon-circle {
    background: #fce4ec;
}

.btn-label {
    font-size: 16px;
    font-weight: 600;
}

.gender-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}
.quiz-reminder {
    margin-top: 10px;
    margin-bottom: 20px;
    background: rgba(246, 230, 230, 0.2);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 12px;
    padding: 12px 18px;
    box-shadow: 0 8px 28px rgba(123, 31, 149, 0.2), inset 0 1px 0 rgba(250, 245, 245, 0.8), inset 0 -1px 0 rgba(142, 36, 170, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    position: relative;
    z-index: 2;
    width: 100%;
    opacity: 0.55;
    color: var(--primary-dark);
}
/* 使用说明卡片 */
.intro-card {
    margin-top: 60px;
    background: rgba(246, 230, 230, 0.2);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 25px 20px;
    box-shadow: 0 8px 28px rgba(123, 31, 149, 0.2), inset 0 1px 0 rgba(245, 236, 236, 0.6), inset 0 -1px 0 rgba(142, 36, 170, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    position: relative;
    z-index: 2;
    width: 90%;
    opacity: 0.7;
}

.intro-title {
    font-size: 16px;
    color: var(--primary-dark);
    margin-bottom: 15px;
    font-weight: 700;
    text-align: center;
}

.intro-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.intro-list li {
    font-size: 14px;
    color: var(--text-color);
    line-height: 2;
    padding-left: 20px;
    position: relative;
}

.intro-list li::before {
    content: "•";
    position: absolute;
    left: 6px;
    color: var(--primary-color);
    font-weight: bold;
}

.set-list {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.set-card {
    background: var(--white);
    border: none;
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    text-align: left;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: transform 0.2s;
}

.set-card:active {
    transform: scale(0.98);
}

.set-info h3 {
    font-size: 18px;
    color: var(--text-color);
    margin-bottom: 4px;
}

.set-info p {
    font-size: 15px;
    color: var(--text-light);
}
.set-info .set-desc {
    padding-right: 10px;
}

.arrow-icon {
    color: var(--primary-color);
    font-weight: bold;
}

/* Quiz Styles */
.quiz-header {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 1000;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
}

.back-btn {
    background: white;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    width: 40px;
    height: 40px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.back-btn:active {
    transform: scale(0.9);
    background: #f5f5f5;
}

.back-btn-round {
    background: white;
    border: none;
    padding: 0;
    cursor: pointer;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(142, 36, 170, 0.2);
    width: 48px;
    height: 48px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    position: absolute;
    top: 20px;
    left: 20px;
}

.back-btn-round:active {
    transform: scale(0.92);
    box-shadow: 0 2px 8px rgba(142, 36, 170, 0.25);
}

.secondary-btn {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.7) 100%);
    border: none;
    color: var(--primary-color);
    border-radius: 100%;
    padding: 15px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(142, 36, 170, 0.15), 0 2px 4px rgba(0, 0, 0, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.8);
    position: absolute;
    overflow: hidden;
    top: 15px;
    left: 15px;
}
.secondary-btn::before {
    content: "← ";
    opacity: 0.7;
}
.secondary-btn:active {
    transform: scale(0.96) translateY(1px);
    box-shadow: 0 2px 8px rgba(142, 36, 170, 0.2);
}

.progress-bar {
    flex: 1;
    height: 6px;
    background: #f0f0f0;
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-light), var(--primary-color));
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 3px;
}

.progress-text {
    font-size: 14px;
    color: var(--text-light);
    width: 40px;
    text-align: right;
    font-weight: 500;
}

#questions-container {
    width: 100%;
    padding-top: 0;
    padding-bottom: 20px;
}

.question-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.question-text {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    line-height: 1.4;
}

.options-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option-label {
    display: flex;
    align-items: center;
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.option-label:active {
    background-color: #f9f9f9;
}

.option-input {
    display: none;
}

.radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #ccc;
    border-radius: 50%;
    margin-right: 12px;
    position: relative;
    flex-shrink: 0;
}

.option-input:checked + .radio-custom {
    border-color: var(--primary-color);
    background-color: var(--primary-color);
}

.option-input:checked + .radio-custom::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
}

.option-input:checked ~ .option-text {
    color: var(--primary-color);
    font-weight: 500;
}

.option-label.selected {
    border-color: var(--primary-color);
    background-color: var(--primary-light);
    background-color: rgba(156, 39, 176, 0.05);
}

.primary-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 30px;
    padding: 15px 40px;
    font-size: 18px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(156, 39, 176, 0.3);
    cursor: pointer;
    width: 100%;
    transition: all 0.2s;
}

.primary-btn:active {
    transform: scale(0.98);
}

.primary-btn:disabled {
    background: #e0e0e0;
    color: #9e9e9e;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

.submit-area {
    width: 100%;
    padding: 20px 0;
    margin-top: 10px;
}

/* Result View */
.result-wrapper {
    justify-content: center;
    min-height: 80vh;
}

.score-circle {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 10px 30px rgba(156, 39, 176, 0.2);
    margin-bottom: 50px;
    border: 4px solid var(--primary-light);
}

.score-label {
    font-size: 14px;
    color: var(--text-light);
}

#final-score {
    font-size: 48px;
    font-weight: 800;
    color: var(--primary-color);
}

.result-title {
    font-size: 24px;
    color: var(--primary-dark);
    margin-bottom: 15px;
}

.result-card {
    background: white;
    padding: 25px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 30px;
    width: 100%;
}

.result-text {
    line-height: 1.6;
    color: var(--text-color);
    text-align: justify;
}

.restart-btn {
    background: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}
