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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    flex: 1;
}

header {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    margin-bottom: 40px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.site-title {
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 700;
}

.site-subtitle {
    font-size: 1.2em;
    opacity: 0.9;
}

/* Views */
.view {
    display: none;
}

.view.active {
    display: block;
}

/* Story List */
.stories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.story-card {
    background: white;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.story-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.story-card h2 {
    font-size: 1.5em;
    margin-bottom: 10px;
    color: #667eea;
}

.story-date {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 12px;
}

.story-excerpt {
    color: #555;
    line-height: 1.5;
}

/* Story Reader */
.back-button {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 1em;
    cursor: pointer;
    margin-bottom: 30px;
    transition: background 0.2s;
    min-height: 44px;
    min-width: 44px;
}

.back-button:hover {
    background: #5568d3;
}

.story-content {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    max-width: 800px;
    margin: 0 auto;
}

.story-content h1 {
    font-size: 2.5em;
    margin-bottom: 20px;
    color: #333;
}

.story-content h2 {
    font-size: 2em;
    margin-top: 30px;
    margin-bottom: 15px;
    color: #444;
}

.story-content h3 {
    font-size: 1.5em;
    margin-top: 25px;
    margin-bottom: 12px;
    color: #555;
}

.story-content p {
    margin-bottom: 15px;
    line-height: 1.8;
}

.story-content ul,
.story-content ol {
    margin-bottom: 15px;
    margin-left: 30px;
}

.story-content li {
    margin-bottom: 8px;
}

.story-content code {
    background: #f4f4f4;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.story-content pre {
    background: #f4f4f4;
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    margin-bottom: 15px;
}

.story-content pre code {
    background: none;
    padding: 0;
}

.story-content blockquote {
    border-left: 4px solid #667eea;
    padding-left: 20px;
    margin: 20px 0;
    color: #666;
    font-style: italic;
}

.story-content img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
    margin: 20px 0;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 1.1em;
}

/* Error State */
.error {
    background: #fee;
    color: #c33;
    padding: 20px;
    border-radius: 5px;
    text-align: center;
    margin: 20px 0;
}

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    color: #666;
    background: white;
    margin-top: 40px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    header {
        padding: 30px 15px;
        margin-bottom: 20px;
    }

    .site-title {
        font-size: 2em;
    }

    .site-subtitle {
        font-size: 1em;
    }

    .stories-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .story-content {
        padding: 20px;
    }

    .story-content h1 {
        font-size: 2em;
    }
}
