/*
Theme Name: 诗词雅集
Theme URI: https://example.com/
Author: 定制开发
Description: 极简古风诗词主题 | 留白素雅 | 书法感 | 暗黑模式
Version: 2.0
License: GPL2
Text Domain: poem-classic
*/

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    font-family: "Noto Serif SC", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, serif;
    background: #f8f5f0;
    color: #554b43;
    line-height: 1.8;
    transition: all 0.3s ease;
}
body.dark {
    background: #1a1817;
    color: #e2d9d0;
}
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}
.wrap {
    padding: 40px 0;
}

/* 标题 */
.site-title {
    text-align: center;
    font-size: 34px;
    font-weight: 400;
    margin: 30px 0;
    letter-spacing: 4px;
    color: #9e2b25;
}
.nav {
    text-align: center;
    margin: 20px 0 40px;
}
.nav a {
    margin: 0 14px;
    color: #554b43;
    text-decoration: none;
    transition: 0.3s;
}
.nav a:hover {
    color: #9e2b25;
}
body.dark .nav a {
    color: #c0b8af;
}

/* 搜索 */
.search-form {
    text-align: center;
    margin: 20px 0;
}
.search-form input {
    padding: 8px 12px;
    width: 280px;
    max-width: 70%;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    color: #333;
}
.search-form button {
    padding: 8px 14px;
    background: #9e2b25;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}
body.dark .search-form input {
    background: #25201b;
    border-color: #444;
    color: #eee;
}

/* 布局 */
.poem-layout {
    display: flex;
    gap: 30px;
    margin: 40px 0;
}
.poem-main { flex: 1; }
.poem-sidebar { width: 300px; }

/* 轮播 */
.swiper {
    width: 100%;
    height: 360px;
    border-radius: 8px;
    overflow: hidden;
    margin: 20px 0 40px;
}
.swiper-slide img {
    width: 100%;
    height: 360px;
    object-fit: cover;
}

/* 卡片 */
.poem-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}
.poem-card {
    background: #fff;
    padding: 22px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    position: relative;
    transition: 0.2s;
}
.poem-card:hover {
    transform: translateY(-3px);
}
body.dark .poem-card {
    background: #25201b;
}
.poem-thumb img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 15px;
}
.poem-card h2 {
    font-size: 20px;
    margin-bottom: 8px;
    color: #9e2b25;
    font-weight: 400;
}
.poem-meta {
    font-size: 14px;
    color: #999;
    margin-bottom: 12px;
}
.poem-content {
    font-size: 15px;
    line-height: 1.8;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.poem-card a {
    color: #9e2b25;
    text-decoration: none;
    font-size: 14px;
}
.seal {
    position: absolute;
    bottom: 15px;
    right: 15px;
    width: 42px;
    opacity: 0.7;
    pointer-events: none;
}

/* 侧边栏 */
.widget {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}
body.dark .widget {
    background: #25201b;
}
.widget h3 {
    font-size: 16px;
    color: #9e2b25;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    margin-bottom: 15px;
}
.widget ul { list-style: none; }
.widget li {
    padding: 7px 0;
    border-bottom: 1px dashed #eee;
}
.widget li:last-child { border: 0; }
.widget a {
    color: #554b43;
    text-decoration: none;
}
body.dark .widget a { color: #ddd; }

/* 分页 */
.pagination {
    text-align: center;
    margin: 50px 0;
}
.pagination ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}
.pagination li a,
.pagination li span {
    display: inline-block;
    padding: 8px 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #554b43;
    text-decoration: none;
}
body.dark .pagination li a,
body.dark .pagination li span {
    border-color: #444;
    color: #ddd;
}
.pagination li.current span {
    background: #9e2b25;
    color: #fff;
    border-color: #9e2b25;
}

/* 毛笔动画 */
.brush-anim {
    display: inline-block;
    overflow: hidden;
    border-right: 2px solid #9e2b25;
    white-space: nowrap;
    animation: brush 2s steps(22, end) forwards;
}
@keyframes brush {
    from { width: 0; }
    to { width: 100%; }
}

/* 操作按钮 */
.action-bar {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 25px 0;
    flex-wrap: wrap;
}
.action-bar button {
    padding: 7px 14px;
    border: 1px solid #9e2b25;
    background: transparent;
    color: #9e2b25;
    border-radius: 4px;
    cursor: pointer;
    transition: 0.3s;
}
.action-bar button.done {
    background: #9e2b25;
    color: #fff;
}

/* 详情页 */
.single-poem {
    max-width: 720px;
    margin: 0 auto;
    padding: 20px;
}
.single-poem h1 {
    text-align: center;
    font-size: 28px;
    color: #9e2b25;
    margin-bottom: 15px;
}
.single-poem .meta {
    text-align: center;
    color: #999;
    margin-bottom: 30px;
}
.single-poem .content {
    font-size: 18px;
    line-height: 2;
    white-space: pre-line;
    margin: 40px 0;
}
.single-poem .section {
    background: #fff8f0;
    padding: 22px;
    border-radius: 6px;
    margin: 25px 0;
}
body.dark .single-poem .section {
    background: #25201b;
}
.single-poem .section h3 {
    color: #9e2b25;
    margin-bottom: 10px;
    font-size: 16px;
}

/* 暗黑切换 */
#dark-toggle {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: #9e2b25;
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 20px;
    z-index: 999;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

/* 响应式 */
@media (max-width: 992px) {
    .poem-list { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 768px) {
    .poem-layout { flex-direction: column; }
    .poem-sidebar { width: 100%; }
    .poem-list { grid-template-columns: 1fr; }
    .swiper { height: 240px; }
    .swiper-slide img { height: 240px; }
    #dark-toggle {
        width: 42px;
        height: 42px;
        bottom: 20px;
        right: 20px;
    }
}