@import url('https://fonts.googleapis.com/css2?family=Ma+Shan+Zheng&family=Noto+Serif+SC:wght@400;500;600;700&display=swap');

:root {
    --color-primary: #8B0000;
    --color-primary-light: #A52A2A;
    --color-primary-dark: #5C0000;
    --color-gold: #D4AF37;
    --color-gold-light: #F0D77E;
    --color-bg: #FDF5E6;
    --color-bg-dark: #F5E6C8;
    --color-text: #2C1810;
    --color-text-light: #5C4033;
    --color-border: #CD853F;
    --color-card: #FFFAF0;
    --color-shadow: rgba(139, 0, 0, 0.15);
    --font-serif: 'Noto Serif SC', serif;
    --font-decorative: 'Ma Shan Zheng', cursive;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-serif);
    background-color: var(--color-bg);
    color: var(--color-text);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
}

.page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
    overflow-y: auto;
    padding-bottom: env(safe-area-inset-bottom);
}

.page.active {
    display: flex;
}

.bg-pattern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(139, 0, 0, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(212, 175, 55, 0.05) 0%, transparent 50%),
        url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 0L30 10M30 50L30 60M0 30L10 30M50 30L60 30' stroke='%238B0000' stroke-width='0.5' opacity='0.05'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
}

.verify-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.decorative-border {
    position: relative;
    background: var(--color-card);
    border: 2px solid var(--color-border);
    border-radius: 8px;
    padding: 30px 25px;
    width: 100%;
    max-width: 360px;
    box-shadow: 
        0 10px 40px var(--color-shadow),
        inset 0 0 30px rgba(139, 0, 0, 0.03);
}

.corner {
    position: absolute;
    width: 20px;
    height: 20px;
    border-color: var(--color-gold);
    border-style: solid;
}

.corner.top-left {
    top: -2px;
    left: -2px;
    border-width: 3px 0 0 3px;
}

.corner.top-right {
    top: -2px;
    right: -2px;
    border-width: 3px 3px 0 0;
}

.corner.bottom-left {
    bottom: -2px;
    left: -2px;
    border-width: 0 0 3px 3px;
}

.corner.bottom-right {
    bottom: -2px;
    right: -2px;
    border-width: 0 3px 3px 0;
}

.verify-header {
    text-align: center;
    margin-bottom: 25px;
}

.title {
    font-family: var(--font-decorative);
    font-size: 36px;
    color: var(--color-primary);
    margin-bottom: 8px;
    text-shadow: 2px 2px 4px rgba(139, 0, 0, 0.1);
}

.subtitle {
    font-size: 15px;
    color: var(--color-text-light);
    letter-spacing: 2px;
}

.ancient-beauty {
    text-align: center;
    margin-bottom: 25px;
}

.beauty-img {
    width: 160px;
    height: 200px;
    object-fit: cover;
    border-radius: 4px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    border: 2px solid var(--color-gold);
}

.verify-form {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.input-group {
    position: relative;
    width: 100%;
    margin-bottom: 20px;
}

.input-group input {
    width: 100%;
    height: 48px;
    padding: 0 15px;
    font-size: 16px;
    font-family: var(--font-serif);
    background: transparent;
    border: 2px solid var(--color-border);
    border-radius: 4px;
    color: var(--color-text);
    outline: none;
    transition: all 0.3s ease;
    letter-spacing: 3px;
}

.input-group input:focus {
    border-color: var(--color-gold);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

.input-group input::placeholder {
    color: var(--color-text-light);
    opacity: 0.6;
    letter-spacing: 1px;
}

.btn-primary, .btn-secondary {
    position: relative;
    width: 100%;
    height: 48px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-family: var(--font-serif);
    font-weight: 600;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(139, 0, 0, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 0, 0, 0.5);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary .btn-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn-primary:hover .btn-glow {
    width: 300px;
    height: 300px;
}

.btn-primary .btn-text {
    position: relative;
    z-index: 1;
    letter-spacing: 4px;
}

.btn-secondary {
    background: transparent;
    color: var(--color-text-light);
    border: 2px solid var(--color-border);
}

.btn-secondary:hover {
    background: var(--color-bg-dark);
    color: var(--color-primary);
}

.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.hint {
    font-size: 12px;
    color: var(--color-text-light);
    margin-top: 15px;
    opacity: 0.7;
}

.quiz-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.quiz-header {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
}

.progress-bar {
    height: 6px;
    background: var(--color-bg-dark);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-gold) 100%);
    width: 0%;
    transition: width 0.3s ease;
}

.question-counter {
    font-size: 14px;
    color: var(--color-text-light);
    text-align: center;
}

.quiz-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.question-card {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 4px 15px var(--color-shadow);
}

.question-number {
    font-size: 13px;
    color: var(--color-text-light);
    margin-bottom: 12px;
    letter-spacing: 2px;
}

.question-title {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.6;
    color: var(--color-text);
}

.options-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option-item {
    position: relative;
    background: var(--color-card);
    border: 2px solid var(--color-border);
    border-radius: 8px;
    padding: 18px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.option-item.selected {
    border-color: var(--color-gold);
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.1) 0%, rgba(139, 0, 0, 0.05) 100%);
}

.option-item:hover {
    border-color: var(--color-gold);
    transform: translateX(5px);
}

.option-letter {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--color-bg-dark);
    color: var(--color-text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.option-item.selected .option-letter {
    background: var(--color-gold);
    color: var(--color-primary);
}

.option-text {
    font-size: 15px;
    line-height: 1.5;
    color: var(--color-text);
}

.quiz-footer {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    padding-bottom: 20px;
}

.quiz-footer button {
    flex: 1;
    height: 46px;
}

.result-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.result-card {
    background: var(--color-card);
    border: 2px solid var(--color-border);
    border-radius: 12px;
    padding: 30px 25px;
    width: 100%;
    max-width: 360px;
    box-shadow: 
        0 15px 50px var(--color-shadow),
        inset 0 0 40px rgba(139, 0, 0, 0.03);
    margin-bottom: 25px;
}

.result-header {
    text-align: center;
    margin-bottom: 25px;
}

.result-title {
    font-family: var(--font-decorative);
    font-size: 32px;
    color: var(--color-primary);
    margin-bottom: 5px;
}

.result-subtitle {
    font-size: 14px;
    color: var(--color-text-light);
    letter-spacing: 3px;
}

.result-main {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
}

.result-image-wrapper {
    flex-shrink: 0;
}

.result-image {
    width: 100px;
    height: 130px;
    object-fit: cover;
    border-radius: 4px;
    border: 2px solid var(--color-gold);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.result-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.result-episode, .result-character {
    display: flex;
    flex-direction: column;
}

.result-episode .label, .result-character .label {
    font-size: 12px;
    color: var(--color-text-light);
    margin-bottom: 3px;
}

.result-episode .value {
    font-family: var(--font-decorative);
    font-size: 28px;
    color: var(--color-primary);
}

.result-character .value {
    font-size: 18px;
    font-weight: 600;
    color: var(--color-text);
}

.result-description {
    background: var(--color-bg-dark);
    border-radius: 6px;
    padding: 18px;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.7;
    color: var(--color-text-light);
    text-align: justify;
}

.result-traits {
    margin-bottom: 10px;
}

.traits-title {
    font-size: 13px;
    color: var(--color-text-light);
    margin-bottom: 12px;
    letter-spacing: 2px;
}

.traits-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.trait-tag {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.2) 0%, rgba(139, 0, 0, 0.1) 100%);
    border: 1px solid var(--color-gold);
    border-radius: 15px;
    padding: 6px 14px;
    font-size: 13px;
    color: var(--color-primary);
}

.result-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 360px;
    padding-bottom: 20px;
}

.result-actions button {
    height: 50px;
}

.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: rgba(44, 24, 16, 0.9);
    color: #fff;
    padding: 15px 25px;
    border-radius: 8px;
    font-size: 14px;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 1000;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.toast.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

@media (max-width: 375px) {
    .decorative-border, .result-card {
        padding: 20px 15px;
    }
    
    .title {
        font-size: 28px;
    }
    
    .beauty-img {
        width: 130px;
        height: 170px;
    }
    
    .question-title {
        font-size: 16px;
    }
    
    .option-item {
        padding: 15px 15px;
    }
    
    .result-main {
        flex-direction: column;
        text-align: center;
    }
    
    .result-image {
        width: 120px;
        height: 150px;
    }
    
    .result-episode .value {
        font-size: 24px;
    }
}

@media (max-height: 600px) {
    .verify-container, .result-container {
        padding: 10px;
    }
    
    .beauty-img {
        width: 100px;
        height: 130px;
    }
    
    .decorative-border, .result-card {
        padding: 15px;
    }
    
    .title {
        font-size: 24px;
    }
    
    .input-group input, .btn-primary, .btn-secondary {
        height: 42px;
        font-size: 14px;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page.active > div:not(.bg-pattern) {
    animation: fadeIn 0.5s ease forwards;
}

.options-list .option-item {
    animation: fadeIn 0.3s ease forwards;
}

.options-list .option-item:nth-child(1) { animation-delay: 0.05s; }
.options-list .option-item:nth-child(2) { animation-delay: 0.1s; }
.options-list .option-item:nth-child(3) { animation-delay: 0.15s; }
.options-list .option-item:nth-child(4) { animation-delay: 0.2s; }