* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --ink: #2c2c2c;
    --ink-light: #666;
    --paper: #f8f5f0;
    --paper-dark: #ebe7e0;
    --red: #a33;
    --gold: #b8860b;
}

body {
    font-family: 'KaiTi', '楷体', 'STKaiti', serif;
    background: var(--paper);
    color: var(--ink);
    min-height: 100vh;
    font-size: 16px;
}

.intro-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--paper);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 6000;
    padding: 20px;
}

.intro-content {
    text-align: center;
    max-width: 500px;
    width: 100%;
}

.intro-title {
    font-size: 28px;
    margin-bottom: 20px;
    letter-spacing: 4px;
}

.title-image-container {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: var(--paper-dark);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
}

.title-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.title-image-container-small {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: var(--paper-dark);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 15px;
}

.title-image-container-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.intro-story {
    text-align: left;
    line-height: 2;
    margin-bottom: 40px;
    padding: 20px;
    background: var(--paper-dark);
    border-radius: 8px;
}

.intro-story p {
    margin-bottom: 10px;
    text-indent: 2em;
}

.intro-hint {
    color: var(--ink-light);
    font-size: 14px;
    margin-top: 20px;
    text-indent: 0 !important;
}

.intro-btn, .start-btn {
    background: var(--ink);
    color: var(--paper);
    border: none;
    border-radius: 8px;
    padding: 15px 40px;
    font-family: inherit;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s;
}

.intro-btn:hover, .start-btn:hover:not(:disabled) {
    background: var(--red);
    transform: translateY(-2px);
}

.start-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.character-select-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--paper);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 5000;
    padding: 20px;
}

.character-select-content {
    text-align: center;
    max-width: 500px;
    width: 100%;
}

.select-title {
    font-size: 28px;
    margin-bottom: 8px;
}

.select-subtitle {
    font-size: 14px;
    color: var(--ink-light);
    margin-bottom: 30px;
}

.character-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 30px;
}

.character-card {
    background: var(--paper-dark);
    border: 2px solid transparent;
    border-radius: 10px;
    padding: 18px;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.character-card:hover {
    border-color: var(--ink-light);
}

.character-card.selected {
    border-color: var(--red);
    background: #f5eaea;
}

.character-card .character-info {
    flex: 1;
}

.character-card .character-name {
    font-size: 18px;
    margin-bottom: 8px;
}

.character-card .character-desc {
    font-size: 13px;
    color: var(--ink-light);
    line-height: 1.6;
    margin-bottom: 10px;
}

.character-card .character-bonus {
    font-size: 12px;
    color: var(--gold);
}

.character-card .character-img {
    height: 80px;
    width: auto;
    margin-left: 15px;
    border-radius: 6px;
    object-fit: cover;
}

.game-container {
    max-width: 500px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 15px;
}

.top-bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #ddd;
    margin-bottom: 15px;
}

.scene-image-container {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: var(--paper-dark);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 15px;
}

.scene-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.game-title {
    font-size: 18px;
    font-weight: bold;
    color: var(--ink);
    margin-bottom: 8px;
    letter-spacing: 2px;
}

.time-display {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.day-text {
    font-size: 20px;
    font-weight: bold;
}

.period-text {
    font-size: 14px;
    color: var(--ink-light);
}

.resource-bar {
    display: flex;
    gap: 15px;
}

.resource {
    font-size: 14px;
    padding: 4px 10px;
    background: var(--paper-dark);
    border-radius: 3px;
}

.resource.silver {
    color: var(--gold);
}

.resource.fatigue {
    color: var(--red);
}

.values-row {
    display: flex;
    flex-direction: row;
    justify-content: center;
    margin-bottom: 15px;
}

.values-text {
    display: flex;
    flex-direction: row;
    gap: 20px;
    justify-content: center;
}

.value-text-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--paper-dark);
    border-radius: 6px;
}

.value-label {
    font-size: 12px;
    color: var(--ink-light);
}

.value-desc {
    font-size: 12px;
    color: var(--gold);
    font-weight: bold;
}

.main-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.story-panel {
    background: var(--paper-dark);
    border-radius: 8px;
    padding: 15px;
}

.story-text {
    line-height: 1.8;
    font-size: 15px;
}

.story-text p {
    margin-bottom: 8px;
    text-indent: 2em;
}

.section-title {
    font-size: 14px;
    color: var(--ink-light);
    margin-bottom: 10px;
}

.disciples-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.disciple-card {
    background: var(--paper);
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.disciple-card:hover {
    border-color: var(--ink-light);
}

.disciple-card.unavailable {
    opacity: 0.5;
}

.disciple-name {
    font-size: 14px;
    margin-bottom: 4px;
}

.disciple-info {
    font-size: 12px;
    color: var(--ink-light);
    display: flex;
    gap: 6px;
}

.actions-panel {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 10px 0;
}

.choices-section {
    background: var(--paper-dark);
    border-radius: 8px;
    padding: 12px;
    margin-top: 10px;
}

.choices-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.choice-btn {
    background: var(--ink);
    color: var(--paper);
    border: none;
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    font-family: inherit;
    text-align: center;
    font-weight: bold;
    transition: all 0.2s;
    line-height: 1.6;
}

.choice-btn:hover {
    background: var(--red);
    transform: translateY(-2px);
}

.choice-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.choice-btn.continue-btn {
    background: var(--ink);
    color: var(--paper);
    text-align: center;
    font-weight: bold;
}

.choice-btn.continue-btn:hover {
    background: var(--red);
}

.trigger-option-btn {
    background: var(--ink);
    color: var(--paper);
    border: none;
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    font-family: inherit;
    text-align: center;
    font-weight: bold;
    transition: all 0.2s;
    line-height: 1.6;
    width: 100%;
}

.trigger-option-btn:hover:not(.disabled) {
    background: var(--red);
    transform: translateY(-2px);
}

.trigger-option-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.achievement-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: linear-gradient(135deg, #2c2c2c 0%, #1a1a1a 100%);
    color: #f8f5f0;
    padding: 30px 50px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

.achievement-modal.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.achievement-content {
    text-align: center;
}

.achievement-title {
    font-size: 14px;
    color: #b8860b;
    margin-bottom: 10px;
    letter-spacing: 2px;
}

.achievement-name {
    font-size: 24px;
    font-weight: bold;
    color: #f8f5f0;
    letter-spacing: 4px;
}

.actions-section {
    background: var(--paper-dark);
    border-radius: 8px;
    padding: 12px;
    margin-top: 10px;
}

.actions-section .section-title {
    font-size: 14px;
    color: var(--ink-light);
    margin-bottom: 10px;
}

.action-btn {
    background: var(--paper);
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    font-family: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    transition: all 0.2s;
}

.action-btn:hover {
    background: var(--paper-dark);
    border-color: var(--ink-light);
}

.action-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.action-name {
    font-size: 16px;
    color: var(--ink);
}

.action-cost {
    font-size: 12px;
    color: var(--ink-light);
}

.bottom-bar {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 10px 0;
    border-top: 1px solid #ddd;
}

.bottom-btn {
    background: transparent;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 8px 16px;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    color: var(--ink-light);
    transition: all 0.2s;
}

.bottom-btn:hover {
    border-color: var(--ink);
    color: var(--ink);
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--paper);
    border-radius: 12px;
    padding: 25px;
    max-width: 400px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    font-size: 18px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #ddd;
}

.modal-body {
    line-height: 1.8;
    margin-bottom: 20px;
}

.modal-body p {
    margin-bottom: 10px;
}

.modal-body h4 {
    margin: 15px 0 8px;
    color: var(--ink-light);
}

.modal-footer {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.modal-footer .menu-btn,
.modal-footer .bottom-btn {
    width: 100%;
    padding: 12px;
    background: var(--paper);
    border: 1px solid #ccc;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    font-size: 15px;
    text-align: center;
}

.modal-footer .menu-btn:hover,
.modal-footer .bottom-btn:hover {
    background: var(--paper-dark);
}

.modal-footer .menu-btn:disabled,
.modal-footer .bottom-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.ending-screen {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--paper);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.ending-screen.active {
    display: flex;
}

.ending-content {
    text-align: center;
    max-width: 400px;
}

.ending-content h1 {
    font-size: 28px;
    margin-bottom: 10px;
}

.ending-subtitle {
    font-size: 16px;
    color: var(--gold);
    margin-bottom: 20px;
}

.ending-text {
    line-height: 1.8;
    margin-bottom: 25px;
    text-align: left;
}

.ending-text p {
    margin-bottom: 8px;
    text-indent: 2em;
}

.ending-stats {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-bottom: 25px;
}

.stat-item {
    text-align: center;
    padding: 10px 15px;
    background: var(--paper-dark);
    border-radius: 6px;
}

.stat-label {
    font-size: 12px;
    color: var(--ink-light);
}

.stat-value {
    font-size: 18px;
    color: var(--gold);
}

.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--ink);
    color: var(--paper);
    padding: 10px 20px;
    border-radius: 6px;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 3000;
}

.toast.show {
    opacity: 1;
}

.time-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.85);
    color: var(--paper);
    padding: 30px 50px;
    border-radius: 12px;
    font-size: 24px;
    z-index: 4000;
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
    text-align: center;
    letter-spacing: 4px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.time-toast.show {
    opacity: 1;
}

.loyalty-high {
    color: var(--gold);
}

.loyalty-low {
    color: var(--red);
}

@media (max-width: 400px) {
    .game-container {
        padding: 10px;
    }
    
    .actions-panel {
        gap: 8px;
    }
    
    .action-btn {
        padding: 12px;
    }
    
    .action-name {
        font-size: 14px;
    }
}
