* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', 'Comic Sans MS', cursive, sans-serif;
    background: linear-gradient(145deg, #ccff00 0%, #bf00ff 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 12px;
    padding-top: 8px;
    overflow-y: auto;
}

.app {
    width: 100%;
    max-width: 480px;
    min-height: 0;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
    border-radius: 32px;
    padding: 24px 20px;
    padding-top: 30px;
    box-shadow: 0 20px 40px rgba(191, 0, 255, 0.4);
    border: 3px solid #ffff00;
    position: relative;
    overflow: hidden;
}

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

.page.active {
    display: flex;
}

/* 首页 */
.glitch-wrapper {
    margin-bottom: 10px;
}

.glitch-title {
    font-size: 60px;
    font-weight: 900;
    color: #ffff00;
    text-shadow: 6px 6px 0 #ff00ff, 10px 10px 0 rgba(0,0,0,0.3);
    letter-spacing: 8px;
    position: relative;
}

@keyframes glitch {
    0% { transform: skew(0deg); }
    20% { transform: skew(5deg); text-shadow: -6px 0 #ff00ff, 6px 0 #00ffff; }
    40% { transform: skew(-5deg); text-shadow: 6px 0 #ff00ff, -6px 0 #00ffff; }
    60% { transform: skew(0deg); }
    100% { transform: skew(0deg); }
}

.subtitle {
    font-size: 24px;
    font-weight: bold;
    color: #000;
    background: #ffff00;
    padding: 8px 24px;
    border-radius: 40px;
    margin: 10px 0;
    border: 3px solid #bf00ff;
}

.desc {
    font-size: 18px;
    color: #fff;
    text-shadow: 2px 2px 0 #bf00ff;
    margin: 16px 0;
}

.meme-preview {
    background: #fff;
    padding: 12px 20px;
    border-radius: 60px;
    font-size: 18px;
    font-weight: bold;
    color: #bf00ff;
    border: 3px dashed #ccff00;
    margin: 20px 0;
}

.footer-note {
    color: #fff;
    margin-top: 24px;
    font-size: 14px;
    opacity: 0.9;
}

/* 按钮 */
.btn {
    padding: 18px 36px;
    font-size: 22px;
    font-weight: 900;
    border: none;
    border-radius: 60px;
    cursor: pointer;
    transition: all 0.1s ease;
    box-shadow: 0 8px 0 rgba(0,0,0,0.2);
    letter-spacing: 2px;
    margin: 10px 0;
    width: 100%;
    max-width: 300px;
    border: 3px solid #000;
}

.btn-primary {
    background: #ccff00;
    color: #000;
    text-shadow: 1px 1px 0 #fff;
}

.btn-secondary {
    background: #bf00ff;
    color: #ffff00;
    text-shadow: 1px 1px 0 #000;
}

.btn:active {
    transform: translateY(4px);
    box-shadow: 0 4px 0 rgba(0,0,0,0.2);
}

.btn:disabled {
    opacity: 0.5;
    transform: none;
    box-shadow: 0 8px 0 rgba(0,0,0,0.2);
    cursor: not-allowed;
}

.btn-jitter {
    animation: jitter 0.2s infinite;
}

@keyframes jitter {
    0% { transform: translate(0, 0); }
    25% { transform: translate(-3px, 2px); }
    50% { transform: translate(3px, -2px); }
    75% { transform: translate(-2px, -3px); }
    100% { transform: translate(0, 0); }
}

/* 进度条 */
.progress-container {
    width: 100%;
    margin-bottom: 30px;
}

.progress-text {
    font-size: 28px;
    font-weight: bold;
    color: #ffff00;
    text-shadow: 3px 3px 0 #bf00ff;
    text-align: center;
    margin-bottom: 8px;
}

.progress-bar-wrapper {
    height: 24px;
    background: #fff;
    border-radius: 30px;
    border: 3px solid #000;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: #ccff00;
    transition: width 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

/* 题目区域 */
.question-text {
    font-size: 24px;
    font-weight: bold;
    color: #fff;
    text-shadow: 2px 2px 0 #bf00ff;
    margin: 20px 0 30px;
    text-align: center;
    line-height: 1.4;
    min-height: 100px;
    display: flex;
    align-items: center;
}

.options-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 30px;
}

.option-btn {
    background: #fff;
    border: 3px solid #000;
    border-radius: 60px;
    padding: 18px 20px;
    font-size: 18px;
    font-weight: bold;
    color: #000;
    text-align: left;
    cursor: pointer;
    transition: all 0.1s;
    box-shadow: 0 5px 0 #bf00ff;
}

.option-btn.selected {
    background: #ccff00;
    border-color: #bf00ff;
    box-shadow: 0 3px 0 #bf00ff;
    transform: translateY(2px);
}

.option-btn:active {
    transform: translateY(3px);
    box-shadow: 0 2px 0 #bf00ff;
}

/* 结果页 */
.result-card {
    background: #fff;
    border-radius: 40px;
    padding: 30px 20px;
    width: 100%;
    border: 5px solid #ccff00;
    box-shadow: 0 10px 0 #bf00ff;
    margin-bottom: 30px;
    text-align: center;
}

.result-tag {
    font-size: 48px;
    font-weight: 900;
    color: #bf00ff;
    text-shadow: 3px 3px 0 #ccff00;
    margin-bottom: 10px;
}

.result-slogan {
    font-size: 28px;
    font-weight: bold;
    color: #000;
    margin: 20px 0;
    line-height: 1.3;
}

.result-meme {
    font-size: 24px;
    color: #ff00ff;
    background: #ffff00;
    display: inline-block;
    padding: 10px 24px;
    border-radius: 40px;
    margin: 10px 0;
    border: 3px dashed #000;
}

.result-personality {
    font-size: 18px;
    color: #333;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 3px dotted #bf00ff;
}

.result-actions {
    display: flex !important;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: stretch;
    gap: 20px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 3px dotted #bf00ff;
    width: 100%;
}

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

.inline-qrcode {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.inline-qrcode .qr-img {
    width: 50%;
    height: auto;
}

.inline-qrcode .share-tip {
    width: 50%;
    font-size: 14px;
}

@media (max-width: 400px) {
    .app { padding: 16px 12px; }
    .glitch-title { font-size: 64px; }
    .question-text { font-size: 20px; }
    .option-btn { padding: 14px 16px; font-size: 16px; }
    
    .result-actions {
        flex-wrap: nowrap !important;
    }
    
    .inline-qrcode .qr-img {
        width: 25%;
    }
    
    .inline-qrcode .share-tip {
        width: 25%;
        font-size: 12px;
    }
}

.share-tip {
    color: #bf00ff;
    font-weight: bold;
    font-size: 18px;
    text-shadow: 0 0 10px rgba(191, 0, 255, 0.5);
}

/* 滚动人格条 */
.personality-ticker {
    width: 100%;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(4px);
    border-radius: 40px;
    margin-bottom: 20px;
    padding: 8px 0;
    border: 2px solid #ffff00;
    white-space: nowrap;
}

.ticker-track {
    display: inline-block;
    animation: tickerScroll 20s linear infinite;
}

.ticker-item {
    display: inline-block;
    padding: 6px 20px;
    margin: 0 8px;
    background: #ccff00;
    border-radius: 30px;
    font-weight: bold;
    color: #000;
    font-size: 16px;
    border: 2px solid #bf00ff;
    box-shadow: 0 2px 0 #bf00ff;
}

@keyframes tickerScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* 结果页内嵌二维码 */
.inline-qrcode {
    background: linear-gradient(135deg, #fff 0%, #f5f5f5 100%);
    border-radius: 20px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    border: 3px solid #bf00ff;
    box-shadow: 0 4px 15px rgba(191, 0, 255, 0.2);
}

.qr-img {
    width: 70px;
    height: 70px;
    border-radius: 12px;
    border: 3px solid #ccff00;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.qr-text {
    flex: 1;
    font-weight: bold;
    color: #bf00ff;
    font-size: 16px;
    line-height: 1.5;
    margin: 0;
}

/* 调整结果页内边距 */
.result-page .result-card {
    margin-bottom: 10px;
}

/* 确保滚动条在结果页正常显示 */
#resultPage {
    justify-content: flex-start;
    padding-top: 10px;
}

/* 二维码文字兜底样式 */
.qr-text-fallback {
    width: 100%;
    text-align: center;
    color: #bf00ff;
    font-weight: bold;
    font-size: 16px;
    line-height: 1.6;
    padding: 10px 0;
}

