
:root {
    --bg-paper: #fdfbf7;
    --ink-black: #2c2c2c;
    --cinnabar: #b22222;
    --faded-ink: #5a5a5a;
    --border-color: #e0dcd5;
    --font-serif: "Kaiti", "STKaiti", "KaiTi", serif;
}

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

body {
    font-family: var(--font-serif);
    background-color: var(--bg-paper);
    color: var(--ink-black);
    line-height: 1.8;
    overflow-x: hidden;
}

/* 宣纸纹理背景 */
.paper-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.08'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: -1;
}

.main-header {
    text-align: center;
    padding: 4rem 1rem 2rem;
    position: relative;
}

.seal {
    display: inline-block;
    width: 60px;
    height: 60px;
    background-color: var(--cinnabar);
    color: white;
    line-height: 60px;
    border-radius: 4px;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 2px 2px 4px rgba(0,0,0,0.2);
    font-weight: bold;
}

h1 {
    font-size: 3rem;
    letter-spacing: 0.5rem;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 0px rgba(0,0,0,0.1);
}

.subtitle {
    color: var(--faded-ink);
    font-size: 1.2rem;
    letter-spacing: 0.2rem;
}

.filter-nav {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin: 2rem 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
}

.filter-nav a {
    text-decoration: none;
    color: var(--faded-ink);
    font-size: 1.1rem;
    transition: color 0.3s;
    position: relative;
}

.filter-nav a:hover, .filter-nav a.active {
    color: var(--cinnabar);
}

.filter-nav a.active::after {
    content: '';
    position: absolute;
    bottom: -1rem;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background-color: var(--cinnabar);
    border-radius: 50%;
}

.poem-gallery {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 3rem;
}

.poem-card {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid var(--border-color);
    padding: 2rem;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.poem-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
}

.vertical-layout .poem-body p {
    writing-mode: vertical-rl;
    text-orientation: upright;
    margin: 0 0.5rem;
    font-size: 1.4rem;
    letter-spacing: 0.3rem;
    height: 200px;
    display: flex;
    align-items: center;
}

.vertical-layout .poem-body {
    display: flex;
    flex-direction: row-reverse;
    justify-content: center;
    margin-top: 2rem;
}

.horizontal-layout .poem-body p {
    margin-bottom: 1rem;
    font-size: 1.2rem;
    text-align: left;
}

.poem-title {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: var(--ink-black);
}

.poem-author {
    color: var(--cinnabar);
    font-size: 1rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--cinnabar);
    padding: 2px 8px;
    display: inline-block;
}

.poem-decoration {
    position: absolute;
    opacity: 0.1;
    pointer-events: none;
}

.ink-splash-1 {
    bottom: -20px;
    right: -20px;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, #000 0%, transparent 70%);
    filter: blur(20px);
}

.bamboo-shadow {
    top: 0;
    right: 0;
    width: 100px;
    height: 100%;
    background: linear-gradient(to right, transparent, rgba(0,0,0,0.1));
    clip-path: polygon(20% 0%, 80% 0%, 100% 100%, 0% 100%);
}

.main-footer {
    text-align: center;
    padding: 3rem;
    color: var(--faded-ink);
    font-size: 0.9rem;
    border-top: 1px solid var(--border-color);
    margin-top: 2rem;
}

@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    .vertical-layout .poem-body p { height: 150px; font-size: 1.2rem; }
    .filter-nav { gap: 1rem; flex-wrap: wrap; }
}
