:root {
    --ink-jiao: #121212;
    --ink-nong: #2a2a2a;
    --ink-zhong: #4a4a4a;
    --ink-dan: #7a7a7a;
    --ink-qing: #a8a8a8;
    --ink-qing-light: #d0d0d0;
    --paper: #f7f2e8;
    --paper-warm: #f0e9db;
    --paper-dark: #e5dcc9;
    --paper-shadow: rgba(139, 119, 101, 0.15);
    --ink-spread: rgba(42, 42, 42, 0.08);
    --transition-slow: 1.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-medium: 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: 0.4s ease;
}

@keyframes inkBleed {
    0% { opacity: 0; transform: scale(0.95); filter: blur(2px); }
    100% { opacity: 1; transform: scale(1); filter: blur(0); }
}

@keyframes inkSpread {
    0% { opacity: 0; transform: scale(0.8); }
    50% { opacity: 0.6; }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes fadeInUp {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInSlow {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

@keyframes inkDrop {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.2); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes brushStroke {
    0% { width: 0; opacity: 0; }
    100% { width: 100%; opacity: 1; }
}

@keyframes floatGentle {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

@keyframes inkDropAnimation {
    0% { transform: translateY(-30px) scale(0); opacity: 0; }
    50% { transform: translateY(0) scale(1.2); opacity: 0.9; }
    100% { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes inkRipple {
    0% { transform: scale(0.8); opacity: 0.6; }
    100% { transform: scale(2); opacity: 0; }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes pageFadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    height: 100%;
    width: 100%;
    overflow-x: hidden;
}

body {
    font-family: "Noto Serif SC", "Source Han Serif CN", "Songti SC", "STSong", "SimSun", serif;
    background-color: var(--paper);
    color: var(--ink-nong);
    line-height: 2;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    position: relative;
    opacity: 0;
    animation: pageFadeIn 1s ease-out forwards;
    background-image: 
        radial-gradient(ellipse at 15% 20%, rgba(139, 119, 101, 0.1) 0%, transparent 45%),
        radial-gradient(ellipse at 85% 80%, rgba(139, 119, 101, 0.08) 0%, transparent 45%),
        radial-gradient(ellipse at 50% 50%, rgba(0, 0, 0, 0.015) 0%, transparent 60%),
        url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    background-blend-mode: multiply;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    background: 
        radial-gradient(ellipse at 10% 90%, var(--ink-spread) 0%, transparent 35%),
        radial-gradient(ellipse at 90% 10%, var(--ink-spread) 0%, transparent 30%),
        radial-gradient(ellipse at 30% 10%, rgba(139, 119, 101, 0.05) 0%, transparent 25%);
    z-index: 0;
}

.ink-wash-corner {
    position: fixed;
    pointer-events: none;
    z-index: 1;
    opacity: 0.15;
}

.ink-wash-corner.top-left {
    top: 0;
    left: 0;
    width: 300px;
    height: 300px;
    background: radial-gradient(ellipse at 0% 0%, var(--ink-dan) 0%, transparent 60%);
}

.ink-wash-corner.bottom-right {
    bottom: 0;
    right: 0;
    width: 350px;
    height: 350px;
    background: radial-gradient(ellipse at 100% 100%, var(--ink-qing) 0%, transparent 55%);
}

.ink-wash-corner.top-right {
    top: 0;
    right: 0;
    width: 250px;
    height: 250px;
    background: radial-gradient(ellipse at 100% 0%, var(--ink-qing-light) 0%, transparent 50%);
}

#app {
    width: 100%;
    max-width: 820px;
    min-height: 650px;
    position: relative;
    z-index: 2;
}

.screen {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 80px 60px;
    background: 
        linear-gradient(135deg, rgba(247, 242, 232, 0.95) 0%, rgba(240, 233, 219, 0.9) 100%);
    border: none;
    position: relative;
    box-shadow: 
        0 8px 40px rgba(0, 0, 0, 0.06),
        0 2px 12px rgba(0, 0, 0, 0.04),
        inset 0 0 80px rgba(139, 119, 101, 0.04);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity var(--transition-slow), transform var(--transition-slow);
}

.screen::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    bottom: 8px;
    border: 1px solid var(--ink-qing-light);
    pointer-events: none;
}

.screen::after {
    content: '';
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    bottom: 12px;
    border: 1px solid rgba(168, 168, 168, 0.3);
    pointer-events: none;
}

.screen.active {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

.screen.exit {
    opacity: 0;
    transform: translateY(-10px);
}

.ink-card {
    background: linear-gradient(180deg, rgba(255, 252, 245, 0.9) 0%, rgba(247, 242, 232, 0.85) 100%);
    padding: 40px;
    margin: 20px 0;
    position: relative;
    border: 1px solid var(--ink-qing-light);
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.04),
        inset 0 0 40px rgba(139, 119, 101, 0.02);
    transition: all var(--transition-medium);
}

.ink-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20%;
    right: 20%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--ink-qing-light), transparent);
}

.ink-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20%;
    right: 20%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--ink-qing-light), transparent);
}

.ink-card:hover {
    box-shadow: 
        0 6px 30px rgba(0, 0, 0, 0.06),
        inset 0 0 40px rgba(139, 119, 101, 0.03);
    transform: translateY(-2px);
}

.game-title {
    font-size: 4.5rem;
    font-weight: 900;
    color: var(--ink-jiao);
    margin-bottom: 30px;
    letter-spacing: 0.6em;
    text-indent: 0.6em;
    text-shadow: 
        2px 2px 4px rgba(0, 0, 0, 0.08),
        0 0 60px rgba(42, 42, 42, 0.1);
    position: relative;
    animation: inkBleed 1.5s ease-out forwards;
}

.poem-subtitle {
    font-size: 1.1rem;
    color: var(--ink-dan);
    margin-bottom: 70px;
    letter-spacing: 0.15em;
    font-style: italic;
    line-height: 2.2;
    opacity: 0;
    animation: fadeInSlow 2s ease-out 0.5s forwards;
}

.chapter-title {
    font-size: 2.8rem;
    font-weight: 700;
    color: var(--ink-jiao);
    margin-bottom: 50px;
    letter-spacing: 0.4em;
    text-indent: 0.4em;
    position: relative;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);
}

.chapter-title::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--ink-zhong), transparent);
}

h2 {
    font-size: 2.2rem;
    color: var(--ink-jiao);
    margin-bottom: 40px;
    letter-spacing: 0.35em;
    font-weight: 600;
}

h3 {
    font-size: 1.5rem;
    color: var(--ink-nong);
    margin-bottom: 25px;
    letter-spacing: 0.2em;
    font-weight: 500;
}

.ink-text {
    font-size: 1.15rem;
    line-height: 2.4;
    color: var(--ink-zhong);
    text-align: justify;
    margin-bottom: 25px;
    letter-spacing: 0.05em;
    text-indent: 2em;
}

.ink-text.center {
    text-align: center;
    text-indent: 0;
}

.ink-divider {
    width: 60%;
    height: 20px;
    margin: 40px auto;
    position: relative;
    overflow: hidden;
}

.ink-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        var(--ink-qing) 15%, 
        var(--ink-dan) 50%, 
        var(--ink-qing) 85%, 
        transparent 100%);
    transform: translateY(-50%);
}

.ink-divider::after {
    content: '◆';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--ink-dan);
    font-size: 0.6rem;
    background: var(--paper);
    padding: 0 15px;
}

.ink-button {
    font-family: inherit;
    font-size: 1.2rem;
    color: var(--paper);
    background: linear-gradient(135deg, var(--ink-nong) 0%, var(--ink-zhong) 100%);
    border: none;
    padding: 18px 56px;
    min-height: 44px;
    cursor: pointer;
    letter-spacing: 0.3em;
    position: relative;
    transition: all var(--transition-medium);
    overflow: hidden;
    margin: 15px;
    touch-action: manipulation;
}

.ink-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.8s ease;
}

.ink-button::after {
    content: '';
    position: absolute;
    inset: 3px;
    border: 1px solid rgba(247, 242, 232, 0.3);
    pointer-events: none;
}

.ink-button:hover {
    background: linear-gradient(135deg, var(--ink-jiao) 0%, var(--ink-nong) 100%);
    transform: translateY(-3px);
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.2),
        0 0 40px rgba(42, 42, 42, 0.1);
    letter-spacing: 0.35em;
}

.ink-button:hover::before {
    left: 100%;
}

.ink-button:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.choice-btn {
    font-family: inherit;
    font-size: 1.05rem;
    color: var(--ink-zhong);
    background: transparent;
    border: 1px solid var(--ink-qing);
    padding: 16px 40px;
    min-height: 48px;
    cursor: pointer;
    letter-spacing: 0.15em;
    position: relative;
    transition: all var(--transition-medium);
    margin: 10px;
    width: 80%;
    max-width: 400px;
    text-align: center;
    touch-action: manipulation;
    display: flex;
    align-items: center;
    justify-content: center;
}

.choice-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: var(--ink-nong);
    transition: width var(--transition-medium);
    z-index: -1;
}

.choice-btn:hover {
    color: var(--paper);
    border-color: var(--ink-nong);
    letter-spacing: 0.2em;
}

.choice-btn:hover::before {
    width: 100%;
}

.choice-btn:active {
    transform: scale(0.98);
}

.ink-input {
    font-family: inherit;
    font-size: 1.1rem;
    color: var(--ink-nong);
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--ink-qing);
    padding: 12px 8px;
    width: 100%;
    max-width: 400px;
    letter-spacing: 0.1em;
    transition: all var(--transition-medium);
    margin: 15px 0;
    outline: none;
}

.ink-input::placeholder {
    color: var(--ink-qing);
    font-style: italic;
}

.ink-input:focus {
    border-bottom-color: var(--ink-nong);
    border-bottom-width: 2px;
    background: radial-gradient(ellipse at 50% 100%, var(--ink-spread) 0%, transparent 70%);
}

.ink-select {
    font-family: inherit;
    font-size: 1.05rem;
    color: var(--ink-nong);
    background: linear-gradient(180deg, rgba(255, 252, 245, 0.9) 0%, rgba(247, 242, 232, 0.9) 100%);
    border: 1px solid var(--ink-qing);
    padding: 12px 40px 12px 16px;
    letter-spacing: 0.1em;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    position: relative;
    transition: all var(--transition-medium);
    outline: none;
    margin: 15px 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%234a4a4a' d='M1.4 0L6 4.6 10.6 0 12 1.4 6 7.4 0 1.4z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
}

.ink-select:focus {
    border-color: var(--ink-nong);
    box-shadow: 0 0 20px var(--ink-spread);
}

.ink-select:hover {
    border-color: var(--ink-dan);
}

.fade-in {
    opacity: 0;
    transform: translateY(15px);
    animation: fadeInUp 1s ease-out forwards;
}

.fade-in.delay-1 { animation-delay: 0.2s; }
.fade-in.delay-2 { animation-delay: 0.4s; }
.fade-in.delay-3 { animation-delay: 0.6s; }
.fade-in.delay-4 { animation-delay: 0.8s; }
.fade-in.delay-5 { animation-delay: 1s; }

.ink-splash {
    position: absolute;
    pointer-events: none;
    border-radius: 50%;
    background: radial-gradient(circle, var(--ink-nong) 0%, var(--ink-zhong) 30%, transparent 70%);
    animation: inkDrop 0.8s ease-out forwards;
}

.decor-ink {
    position: absolute;
    pointer-events: none;
    opacity: 0.08;
    border-radius: 50%;
    background: radial-gradient(ellipse at center, var(--ink-dan) 0%, transparent 70%);
}

.decor-ink-1 {
    top: -50px;
    right: -80px;
    width: 200px;
    height: 150px;
    transform: rotate(-15deg);
}

.decor-ink-2 {
    bottom: -60px;
    left: -70px;
    width: 180px;
    height: 130px;
    transform: rotate(25deg);
}

.decor-ink-3 {
    top: 30%;
    left: -100px;
    width: 120px;
    height: 120px;
}

.options-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin-top: 30px;
}

.form-group {
    width: 100%;
    max-width: 400px;
    margin: 20px 0;
    text-align: left;
}

.form-label {
    display: block;
    font-size: 1rem;
    color: var(--ink-dan);
    margin-bottom: 8px;
    letter-spacing: 0.15em;
}

.typewriter {
    overflow: hidden;
    border-right: 2px solid var(--ink-zhong);
    white-space: nowrap;
    animation: blink 0.8s step-end infinite;
}

@keyframes blink {
    0%, 100% { border-color: var(--ink-zhong); }
    50% { border-color: transparent; }
}

@media (max-width: 1023px) and (min-width: 768px) {
    body {
        padding: 25px;
    }
    
    .screen {
        padding: 60px 45px;
    }
    
    .game-title {
        font-size: 3.8rem;
        letter-spacing: 0.5em;
    }
    
    .poem-subtitle {
        font-size: 1.05rem;
        margin-bottom: 60px;
    }
    
    .chapter-title {
        font-size: 2.4rem;
    }
    
    .ink-card {
        padding: 32px;
    }
    
    .ink-text {
        font-size: 1.1rem;
    }
}

@media (max-width: 767px) {
    body {
        padding: 10px;
        padding-bottom: env(safe-area-inset-bottom, 20px);
    }
    
    .screen {
        padding: 40px 20px;
    }
    
    .game-title {
        font-size: 2.6rem;
        letter-spacing: 0.35em;
        text-indent: 0.35em;
        margin-bottom: 20px;
    }
    
    .poem-subtitle {
        font-size: 0.9rem;
        margin-bottom: 40px;
        letter-spacing: 0.1em;
    }
    
    .chapter-title {
        font-size: 1.8rem;
        letter-spacing: 0.25em;
        margin-bottom: 35px;
    }
    
    h2 {
        font-size: 1.5rem;
        letter-spacing: 0.25em;
    }
    
    h3 {
        font-size: 1.2rem;
    }
    
    .ink-button {
        font-size: 1rem;
        padding: 12px 32px;
        letter-spacing: 0.2em;
        margin: 8px;
        min-height: 44px;
    }
    
    .choice-btn {
        width: 100%;
        font-size: 1rem;
        padding: 14px 16px;
        margin: 6px 0;
        min-height: 48px;
    }
    
    .ink-card {
        padding: 22px 18px;
        margin: 12px 0;
    }
    
    .ink-text {
        font-size: 1rem;
        line-height: 2;
        letter-spacing: 0.03em;
    }
    
    .ink-input {
        font-size: 16px;
        padding: 12px 8px;
    }
    
    .ink-wash-corner {
        display: none;
    }
    
    .decor-ink {
        opacity: 0.05;
    }
    
    .options-container {
        margin-top: 20px;
    }
    
    .ink-divider {
        width: 75%;
        margin: 25px auto;
    }
}

.progress-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px 0 30px;
    width: 100%;
    max-width: 400px;
}

.progress-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid var(--ink-qing);
    background: var(--paper);
    transition: all var(--transition-medium);
    position: relative;
}

.progress-dot.active {
    border-color: var(--ink-nong);
    background: var(--ink-nong);
    box-shadow: 0 0 15px var(--ink-spread);
    animation: inkDropAnimation 0.5s ease-out forwards;
}

.progress-dot.completed {
    border-color: var(--ink-zhong);
    background: var(--ink-zhong);
}

.progress-line {
    flex: 1;
    height: 2px;
    background: linear-gradient(90deg, var(--ink-qing-light), var(--ink-qing));
    margin: 0 8px;
    position: relative;
    overflow: hidden;
}

.progress-line::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: var(--ink-nong);
    transition: width var(--transition-slow);
}

.progress-line.filled::after {
    width: 100%;
}

.step-content {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.name-input-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.name-input-wrapper .ink-input {
    flex: 1;
    margin: 0;
}

.ink-button-mini {
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--ink-zhong);
    background: transparent;
    border: 1px solid var(--ink-qing);
    padding: 10px 18px;
    min-height: 44px;
    cursor: pointer;
    letter-spacing: 0.1em;
    white-space: nowrap;
    transition: all var(--transition-fast);
    touch-action: manipulation;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ink-button-mini:hover {
    color: var(--paper);
    background: var(--ink-nong);
    border-color: var(--ink-nong);
}

.gender-selector {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

.gender-selector .choice-btn {
    flex: 1;
    margin: 0;
    width: auto;
}

.date-selector {
    margin-top: 10px;
}

.date-selects {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.date-selects .ink-select {
    margin: 5px;
    min-width: 90px;
}

.place-region {
    margin-bottom: 25px;
}

.region-label {
    text-align: center;
    margin-bottom: 12px;
}

.place-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.place-grid .choice-btn {
    margin: 0;
    width: 100%;
    padding: 12px 8px;
    font-size: 0.95rem;
}

.family-dimension {
    margin-bottom: 25px;
}

.family-dimension .form-label {
    text-align: center;
    margin-bottom: 12px;
}

.family-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.family-option {
    margin: 0;
    padding: 18px 12px;
    text-align: center;
    cursor: pointer;
    font-size: 0.95rem;
    letter-spacing: 0.1em;
    color: var(--ink-zhong);
    background: linear-gradient(180deg, rgba(255, 252, 245, 0.7) 0%, rgba(247, 242, 232, 0.6) 100%);
    border: 1px solid var(--ink-qing-light);
    transition: all var(--transition-medium);
    box-shadow: none;
    transform: none;
}

.family-option::before,
.family-option::after {
    display: none;
}

.family-option:hover {
    border-color: var(--ink-dan);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.family-option.selected {
    border-color: var(--ink-nong);
    background: linear-gradient(135deg, var(--ink-nong) 0%, var(--ink-zhong) 100%);
    color: var(--paper);
    box-shadow: 0 4px 20px rgba(42, 42, 42, 0.2);
}

.choice-btn.selected {
    background: var(--ink-nong);
    color: var(--paper);
    border-color: var(--ink-nong);
}

.choice-btn.selected::before {
    width: 100%;
}

.create-nav {
    display: flex;
    gap: 20px;
    margin-top: 30px;
}

.ink-button.secondary {
    background: transparent;
    color: var(--ink-zhong);
    border: 1px solid var(--ink-qing);
}

.ink-button.secondary::after {
    border-color: var(--ink-qing);
}

.ink-button.secondary:hover {
    background: var(--ink-qing-light);
    color: var(--ink-nong);
    border-color: var(--ink-dan);
}

.ink-button.disabled,
.ink-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.ink-button.disabled:hover,
.ink-button:disabled:hover {
    letter-spacing: 0.3em;
    background: linear-gradient(135deg, var(--ink-nong) 0%, var(--ink-zhong) 100%);
}

.casting-container {
    text-align: center;
    padding: 40px 20px;
}

.ink-loading {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto 30px;
}

.ink-drop {
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--ink-nong) 0%, var(--ink-zhong) 60%, transparent 100%);
    left: 50%;
    transform: translateX(-50%);
}

.ink-drop.drop-1 {
    top: 0;
    animation: inkDropAnimation 1s ease-in-out infinite;
}

.ink-drop.drop-2 {
    top: 0;
    animation: inkDropAnimation 1s ease-in-out 0.3s infinite;
    width: 16px;
    height: 16px;
}

.ink-drop.drop-3 {
    top: 0;
    animation: inkDropAnimation 1s ease-in-out 0.6s infinite;
    width: 12px;
    height: 12px;
}

.casting-text {
    font-size: 1.1rem;
    color: var(--ink-dan);
    letter-spacing: 0.2em;
    animation: pulse 2s ease-in-out infinite;
}

@media (max-width: 767px) {
    .place-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .family-options {
        grid-template-columns: 1fr;
    }
    
    .date-selects {
        flex-direction: column;
        align-items: center;
    }
    
    .date-selects .ink-select {
        width: 100%;
        max-width: 200px;
    }
    
    .name-input-wrapper {
        flex-direction: column;
    }
    
    .name-input-wrapper .ink-input {
        width: 100%;
    }
    
    .progress-indicator {
        max-width: 280px;
    }
    
    .create-nav {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }
    
    .create-nav .ink-button {
        width: 100%;
        margin: 5px 0;
    }
}

@media (max-width: 479px) {
    .place-grid {
        grid-template-columns: 1fr;
    }
    
    .date-selects .ink-select {
        max-width: 180px;
    }
    
    .progress-indicator {
        max-width: 240px;
    }
    
    .progress-dot {
        width: 12px;
        height: 12px;
    }
}

#screen-soul-setting {
    max-height: 90vh;
    overflow-y: auto;
    padding: 40px 30px;
}

.soul-intro-card {
    max-width: 600px;
    padding: 25px 35px;
}

.soul-options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    width: 100%;
    max-width: 750px;
    margin: 20px auto;
}

.soul-card {
    margin: 0;
    padding: 0;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(180deg, rgba(255, 252, 245, 0.85) 0%, rgba(247, 242, 232, 0.75) 100%);
}

.soul-card::before,
.soul-card::after {
    display: none;
}

.soul-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
    background: linear-gradient(180deg, rgba(255, 252, 245, 0.95) 0%, rgba(247, 242, 232, 0.9) 100%);
}

.soul-card.selected {
    border-color: var(--ink-nong);
    background: linear-gradient(135deg, rgba(42, 42, 42, 0.05) 0%, rgba(247, 242, 232, 0.9) 100%);
    box-shadow: 0 6px 25px rgba(42, 42, 42, 0.15), inset 0 0 40px rgba(42, 42, 42, 0.03);
    transform: translateY(-2px);
}

.soul-card.selected::before {
    display: block;
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px solid var(--ink-nong);
    pointer-events: none;
}

.soul-image-mark {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: var(--ink-dan);
    border: 1px solid var(--ink-qing-light);
    background: rgba(255, 252, 245, 0.8);
    font-family: "Noto Serif SC", "Source Han Serif CN", "Songti SC", serif;
}

.soul-card.selected .soul-image-mark {
    color: var(--paper);
    background: var(--ink-nong);
    border-color: var(--ink-nong);
}

.soul-content {
    padding: 25px;
    padding-top: 65px;
}

.soul-appearance {
    font-size: 0.95rem;
    line-height: 1.9;
    color: var(--ink-zhong);
    margin-bottom: 12px;
    text-align: left;
    font-style: italic;
    letter-spacing: 0.05em;
}

.soul-metaphor {
    font-size: 1rem;
    line-height: 2;
    color: var(--ink-nong);
    margin-bottom: 15px;
    text-align: left;
    font-weight: 500;
    letter-spacing: 0.05em;
}

.soul-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}

.trait-tag {
    font-size: 0.8rem;
    color: var(--ink-dan);
    padding: 3px 12px;
    border: 1px solid var(--ink-qing-light);
    background: rgba(247, 242, 232, 0.5);
    letter-spacing: 0.1em;
}

.soul-card.selected .trait-tag {
    color: var(--ink-zhong);
    border-color: var(--ink-qing);
}

.soul-traits {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.trait-bar {
    display: flex;
    align-items: center;
    gap: 10px;
}

.trait-label {
    font-size: 0.75rem;
    color: var(--ink-dan);
    white-space: nowrap;
    min-width: 28px;
    letter-spacing: 0.05em;
}

.trait-label.left {
    text-align: right;
}

.trait-label.right {
    text-align: left;
}

.trait-track {
    flex: 1;
    height: 6px;
    background: linear-gradient(90deg, var(--ink-qing-light) 0%, var(--paper-dark) 50%, var(--ink-qing-light) 100%);
    position: relative;
    overflow: hidden;
}

.trait-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--ink-dan) 0%, var(--ink-nong) 100%);
    transition: width 1s ease-out;
}

.soul-confirm-area {
    margin-top: 20px;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.soul-transition-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at center, rgba(247, 242, 232, 0.98) 0%, rgba(240, 233, 219, 0.99) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    transition: opacity 1.2s ease;
}

.soul-transition-overlay.active {
    opacity: 1;
}

.transition-text {
    font-size: 1.3rem;
    color: var(--ink-nong);
    letter-spacing: 0.3em;
    animation: fadeInSlow 1.5s ease-out forwards, pulse 2.5s ease-in-out infinite 1.5s;
}

.enter-world-container {
    margin-top: 30px;
}

@media (max-width: 767px) {
    #screen-soul-setting {
        padding: 25px 15px;
    }

    .soul-options-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        max-width: 450px;
    }

    .soul-content {
        padding: 18px;
        padding-top: 55px;
    }

    .soul-image-mark {
        width: 32px;
        height: 32px;
        font-size: 1.1rem;
        top: 10px;
        right: 10px;
    }

    .soul-appearance {
        font-size: 0.85rem;
    }

    .soul-metaphor {
        font-size: 0.9rem;
    }

    .trait-label {
        font-size: 0.65rem;
        min-width: 22px;
    }
    
    .soul-intro-card {
        padding: 20px;
    }
}

@media (max-width: 479px) {
    .soul-intro-card {
        padding: 18px 15px;
    }

    .soul-content {
        padding: 15px;
        padding-top: 50px;
    }
}

.game-screen {
    padding: 40px 50px !important;
    justify-content: flex-start !important;
}

.game-top-bar {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 10px;
}

.game-top-bar .chapter-title {
    margin-bottom: 15px !important;
    font-size: 2.2rem !important;
}

.game-time-display {
    display: flex;
    gap: 25px;
    font-size: 0.95rem;
    color: var(--ink-dan);
    letter-spacing: 0.1em;
}

.time-date, .time-age {
    padding: 4px 12px;
    border: 1px solid var(--ink-qing-light);
    background: rgba(255, 252, 245, 0.6);
}

.game-narration-card {
    width: 100%;
    min-height: 180px;
    padding: 35px 40px !important;
    margin: 15px 0 !important;
}

.game-bottom-bar {
    width: 100%;
    margin-top: auto;
    padding-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.status-bar {
    display: flex;
    gap: 25px;
    flex: 1;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 140px;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--ink-dan);
    letter-spacing: 0.1em;
    white-space: nowrap;
}

.stat-track {
    flex: 1;
    height: 6px;
    background: var(--ink-qing-light);
    position: relative;
    overflow: hidden;
}

.stat-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    transition: width 0.8s ease;
}

.stat-mood {
    background: linear-gradient(90deg, var(--ink-dan), var(--ink-zhong));
}

.stat-health {
    background: linear-gradient(90deg, #8b4513, #2a2a2a);
}

.speed-controls {
    display: flex;
    gap: 8px;
}

.speed-btn {
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--ink-dan);
    background: transparent;
    border: 1px solid var(--ink-qing-light);
    padding: 8px 16px;
    min-height: 44px;
    min-width: 48px;
    cursor: pointer;
    letter-spacing: 0.1em;
    transition: all var(--transition-fast);
    touch-action: manipulation;
    display: flex;
    align-items: center;
    justify-content: center;
}

.speed-btn:hover {
    color: var(--ink-zhong);
    border-color: var(--ink-dan);
}

.speed-btn:active {
    transform: scale(0.95);
    background: var(--ink-qing-light);
}

.speed-btn.active {
    background: var(--ink-nong);
    color: var(--paper);
    border-color: var(--ink-nong);
}

.speed-btn.locked {
    opacity: 0.4;
    cursor: not-allowed;
}

.save-btn {
    font-size: 0.85rem;
    padding: 6px 12px;
    min-width: 36px;
    color: var(--ink-zhong);
    border-color: var(--ink-qing);
}

.save-btn:hover {
    color: var(--paper);
    background: var(--ink-nong);
    border-color: var(--ink-nong);
}

.ink-button:active,
.choice-btn:active,
.ink-button-mini:active {
    transform: scale(0.97);
}

button {
    touch-action: manipulation;
}

.sense-tag {
    display: inline;
    font-size: 0.95em;
    opacity: 0.85;
}

.sense-label {
    font-size: 0.8em;
    font-style: italic;
    opacity: 0.7;
    margin-right: 2px;
}

.sense-visual {
    color: var(--ink-zhong);
}

.sense-audio {
    color: var(--ink-dan);
    font-style: italic;
}

.sense-smell {
    color: #6b5344;
}

.sense-touch {
    color: #5a4a3a;
}

.sense-taste {
    color: #7a5c4a;
}

.typing-cursor {
    display: inline-block;
    color: var(--ink-nong);
    animation: blink 0.8s step-end infinite;
    font-weight: 300;
    margin-left: 2px;
}

.silence-indicator {
    display: flex;
    gap: 12px;
    align-items: center;
}

.ink-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--ink-qing);
    animation: pulse 1.5s ease-in-out infinite;
}

.free-input-container {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.free-input {
    text-align: center;
    max-width: 350px;
}

.input-hint {
    font-size: 0.8rem;
    color: var(--ink-qing);
    font-style: italic;
    letter-spacing: 0.1em;
}

.hidden {
    display: none !important;
}

@media (max-width: 767px) {
    .game-screen {
        padding: 25px 18px !important;
        padding-bottom: calc(25px + env(safe-area-inset-bottom, 0px)) !important;
    }

    .game-top-bar {
        margin-bottom: 8px;
    }

    .game-top-bar .chapter-title {
        font-size: 1.6rem !important;
        margin-bottom: 10px !important;
    }

    .game-time-display {
        gap: 8px;
        font-size: 0.8rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    .game-narration-card {
        padding: 18px 16px !important;
        min-height: 120px;
        margin: 10px 0 !important;
    }

    .game-bottom-bar {
        flex-direction: column;
        gap: 10px;
        padding-top: 12px;
    }

    .status-bar {
        width: 100%;
        flex-direction: column;
        gap: 8px;
    }

    .stat-item {
        min-width: auto;
        width: 100%;
        gap: 8px;
    }

    .stat-label {
        font-size: 0.8rem;
        min-width: 32px;
    }

    .game-controls-right {
        width: 100%;
        display: flex;
        justify-content: center;
        flex-wrap: nowrap;
        gap: 6px;
    }

    .speed-controls {
        gap: 4px;
        display: flex;
    }

    .speed-btn {
        font-size: 0.85rem;
        padding: 8px 10px;
        min-height: 44px;
        min-width: 48px;
        flex: 1;
    }

    .save-btn {
        font-size: 0.85rem;
        padding: 8px 10px;
        min-width: 44px;
        min-height: 44px;
    }
    
    #btn-rewind {
        font-size: 0.75rem !important;
        padding: 6px 8px !important;
        min-width: 50px !important;
        min-height: 44px !important;
        flex: 1.2;
    }
}

@media (max-width: 479px) {
    body {
        padding: 6px;
        padding-bottom: env(safe-area-inset-bottom, 10px);
    }
    
    .screen {
        padding: 25px 12px;
    }
    
    .game-title {
        font-size: 2rem;
        letter-spacing: 0.2em;
        text-indent: 0.2em;
        margin-bottom: 15px;
    }
    
    .poem-subtitle {
        font-size: 0.85rem;
        margin-bottom: 30px;
        letter-spacing: 0.08em;
        line-height: 1.9;
    }
    
    .chapter-title {
        font-size: 1.4rem;
        letter-spacing: 0.18em;
        margin-bottom: 22px;
    }
    
    .ink-button {
        font-size: 1rem;
        padding: 10px 24px;
        min-height: 44px;
        margin: 6px;
    }
    
    .ink-card {
        padding: 16px 12px;
        margin: 8px 0;
    }
    
    .ink-text {
        font-size: 0.95rem;
        line-height: 1.9;
    }
    
    .ink-divider {
        width: 90%;
        margin: 18px auto;
    }
    
    .choice-btn {
        font-size: 0.95rem;
        padding: 12px 12px;
        min-height: 48px;
    }
    
    .speed-btn {
        font-size: 0.8rem;
        padding: 6px 8px;
        min-height: 38px;
        min-width: 36px;
    }
    
    .game-screen {
        padding: 18px 10px !important;
    }

    .game-top-bar .chapter-title {
        font-size: 1.3rem !important;
    }

    .game-narration-card {
        padding: 15px 12px !important;
    }

    .time-date, .time-age {
        padding: 3px 6px;
        font-size: 0.7rem;
    }

    .game-controls-right {
        gap: 4px;
    }

    #btn-rewind {
        font-size: 0.7rem !important;
        padding: 6px 6px !important;
        min-width: 44px !important;
    }
}

@media (max-width: 360px) {
    .game-title {
        font-size: 1.7rem;
        letter-spacing: 0.15em;
        text-indent: 0.15em;
    }
    
    .chapter-title {
        font-size: 1.2rem;
        letter-spacing: 0.12em;
    }
    
    .speed-btn {
        font-size: 0.75rem;
        padding: 5px 6px;
        min-width: 32px;
    }
    
    #btn-rewind {
        font-size: 0.65rem !important;
        min-width: 40px !important;
    }
}

@media (min-width: 768px) {
    .game-controls-right {
        display: flex;
        align-items: center;
        gap: 10px;
    }
}

.game-controls-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.ending-card {
    transition: all 0.6s ease;
}

.ending-card:hover {
    border-color: rgba(200, 180, 150, 0.4) !important;
    transform: translateY(-2px);
}


/* 按钮禁用状态 - 注意：不使用disabled属性(会阻止click事件) */
.ink-button.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.ink-button.disabled:hover {
    transform: none;
    box-shadow: none;
    background: linear-gradient(135deg, var(--ink-nong) 0%, var(--ink-zhong) 100%);
    letter-spacing: 0.3em;
}

.ink-button.disabled:hover::before {
    left: -100%;
}

/* 按钮抖动动画 - 验证失败提示 */
@keyframes buttonShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-5px); }
    80% { transform: translateX(5px); }
}

.ink-button.shake {
    animation: buttonShake 0.5s ease-in-out;
}
