/*
 * 万妖录 最终完整样式（字段标题墨红色版）
 * 古雅奇幻风，响应式，涵盖首页/列表/正文/通用组件
 */

/* ==================== 设计变量 ==================== */
:root {
    --wyl-bg:            #fdfbf7;
    --wyl-card-bg:       #ffffff;
    --wyl-primary:       #8B0000;
    --wyl-primary-dark:  #5C0000;
    --wyl-gold:          #c4a747;
    --wyl-text:          #3a2c1c;
    --wyl-light-text:    #777777;
    --wyl-border:        #e0d5c1;
    --wyl-shadow:        0 4px 15px rgba(0,0,0,0.08);
    --wyl-radius:        12px;
}

/* ==================== 全局容器 ==================== */
.wyl-homepage-wrapper { width: 100%; overflow-x: hidden; }
.wyl-homepage,
.wyl-archive-wrapper,
.wyl-single-wrapper {
    max-width: 1280px;
    margin: 30px auto;
    padding: 0 20px;
    box-sizing: border-box;
}

/* 面包屑 */
.wyl-breadcrumb {
    font-size: 0.9em; color: var(--wyl-light-text); margin-bottom: 0;
    padding: 8px 15px; background: #f9f6f0; border-radius: 6px;
    display: inline-block;
}
.wyl-breadcrumb a { color: var(--wyl-primary); text-decoration: none; }
.wyl-breadcrumb a:hover { text-decoration: underline; }

/* 通用区块标题 */
.wyl-section-heading,
.wyl-section-title {
    font-size: 1.6em; color: var(--wyl-primary); margin-bottom: 20px;
    position: relative; padding-bottom: 8px;
}
.wyl-section-title::after {
    content: ''; position: absolute; bottom: 0; left: 0;
    width: 50px; height: 3px; background: var(--wyl-gold);
}

/* 搜索框 */
.wyl-search-box { margin: 15px 0; }
#wyl-search-results {
    background: #fff; border: 1px solid #ccc; max-height: 300px;
    overflow-y: auto; border-radius: 5px; z-index: 100;
}

/* ==================== 归档页英雄区 ==================== */
.wyl-archive-hero {
    background: linear-gradient(270deg, #ff9a9e, #fad0c4, #a18cd1, #fbc2eb);
    background-size: 400% 400%;
    animation: gradientBG 12s ease infinite;
    border-radius: 15px;
    padding: 50px 30px;
    text-align: center;
    margin: 25px 0 30px;
    color: #2c1810;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

@keyframes gradientBG {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.wyl-hero-content {
    max-width: 700px;
    margin: 0 auto;
}

.wyl-archive-title {
    font-size: 2.5em;
    font-weight: bold;
    margin-bottom: 10px;
    text-shadow: 1px 1px 2px rgba(255,255,255,0.5);
}

.wyl-archive-desc {
    font-size: 1.2em;
    margin-bottom: 25px;
    color: #4a2c2c;
}

/* 美化搜索框 */
.wyl-search-box {
    position: relative;
    margin: 0 auto;
    max-width: 500px;
}

#wyl-search-input {
    width: 100%;
    padding: 15px 20px;
    font-size: 1.1em;
    border: 2px solid rgba(255,255,255,0.6);
    border-radius: 50px;
    background: rgba(255,255,255,0.85);
    color: var(--wyl-text);
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
}

#wyl-search-input:focus {
    border-color: var(--wyl-primary);
    box-shadow: 0 0 15px rgba(139,0,0,0.2);
}

#wyl-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 10px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
    margin-top: 5px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

/* ==================== 首页 ==================== */
.wyl-homepage { display: flex; gap: 30px; align-items: flex-start; flex-wrap: wrap; }
.wyl-home-main { flex: 1 1 70%; min-width: 0; }
.wyl-home-sidebar {
    flex: 0 0 300px; width: 300px; position: sticky; top: 20px;
    background: var(--wyl-card-bg); border: 1px solid var(--wyl-border);
    border-radius: var(--wyl-radius); padding: 25px; box-shadow: var(--wyl-shadow);
    box-sizing: border-box;
}

.wyl-banner {
    background: linear-gradient(135deg, #1a1a2e, #2a2a3e); color: #e0c97f;
    border-radius: 15px; padding: 60px 30px; text-align: center; margin-bottom: 40px;
    width: 100%; box-sizing: border-box;
}
.wyl-banner-title { font-size: 2.8em; margin-bottom: 10px; }
.wyl-banner-desc { font-size: 1.2em; color: #ccc; margin-bottom: 30px; }

.wyl-category-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 25px; margin-bottom: 40px; }
.wyl-category-card {
    background: #fff; border: 1px solid var(--wyl-border); border-radius: var(--wyl-radius);
    padding: 25px 15px; text-align: center; text-decoration: none; color: var(--wyl-text);
    transition: transform 0.2s, box-shadow 0.2s; box-sizing: border-box;
}
.wyl-category-card:hover { transform: translateY(-5px); box-shadow: 0 8px 20px rgba(0,0,0,0.15); }
.wyl-category-icon {
    width: 80px; height: 80px; margin: 0 auto 15px; background: #f4e9d8;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 2em; color: var(--wyl-primary);
}
.wyl-category-count { display: inline-block; margin-top: 10px; background: var(--wyl-primary); color: #fff; padding: 3px 12px; border-radius: 15px; font-size: 0.9em; }

.wyl-home-features { display: flex; gap: 30px; margin-bottom: 40px; }
.wyl-feature-left, .wyl-feature-right { flex: 1; min-width: 0; background: #f9f6f0; border-radius: var(--wyl-radius); padding: 25px; box-sizing: border-box; }

.wyl-hot-list { list-style: none; padding: 0; margin: 0; }
.wyl-hot-list li { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid #eee; }
.wyl-hot-list a { display: flex; align-items: center; text-decoration: none; color: var(--wyl-text); }
.wyl-hot-list img { width: 50px; height: 50px; object-fit: cover; border-radius: 6px; margin-right: 12px; }

.wyl-tools-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 40px; }
.wyl-tool-card {
    background: #fff; border: 1px solid var(--wyl-border); border-radius: var(--wyl-radius);
    padding: 25px; text-align: center; text-decoration: none; color: var(--wyl-text);
    transition: transform 0.2s; box-sizing: border-box;
}
.wyl-tool-card:hover { transform: translateY(-5px); }

/* ==================== 列表/分类页 ==================== */
.wyl-archive-container {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    margin-top: 10px;
}
.wyl-archive-main {
    flex: 1 1 75%;
    min-width: 0;
}

/* 侧边栏透明 */
.wyl-archive-sidebar {
    flex: 0 0 280px;
    width: 280px;
    position: sticky;
    top: 20px;
    background: transparent;
    border: none;
    padding: 0;
    box-shadow: none;
}

.wyl-sidebar-widget {
    margin-bottom: 25px;
    background: transparent;
}

.wyl-sidebar-title {
    font-size: 1.1em;
    color: var(--wyl-primary);
    border-bottom: 2px solid var(--wyl-gold);
    padding-bottom: 8px;
    margin-bottom: 12px;
}

.wyl-category-list,
.wyl-danger-filter {
    list-style: none;
    padding: 0;
    margin: 0;
}

.wyl-category-list li,
.wyl-danger-filter li {
    margin-bottom: 8px;
}

.wyl-category-list a,
.wyl-danger-filter a {
    text-decoration: none;
    color: var(--wyl-text);
    transition: color 0.2s;
}

.wyl-category-list a:hover,
.wyl-danger-filter a:hover {
    color: var(--wyl-primary);
}

.wyl-archive-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 25px; margin-bottom: 40px; }
.wyl-archive-card {
    background: var(--wyl-card-bg); border-radius: var(--wyl-radius); overflow: hidden;
    box-shadow: var(--wyl-shadow); transition: transform 0.2s, box-shadow 0.2s;
    display: flex; flex-direction: column;
}
.wyl-archive-card:hover { transform: translateY(-6px); box-shadow: 0 10px 25px rgba(0,0,0,0.12); }
.wyl-archive-card-link { text-decoration: none; color: inherit; display: flex; flex-direction: column; height: 100%; }
.wyl-archive-card-thumb { position: relative; height: 200px; background: #f4e9d8; overflow: hidden; }
.wyl-archive-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.wyl-no-image { display: flex; align-items: center; justify-content: center; height: 100%; font-size: 3em; color: #ccc; }
.wyl-archive-card-danger { position: absolute; top: 10px; right: 10px; background: rgba(0,0,0,0.65); color: #ffd700; padding: 4px 10px; border-radius: 20px; font-size: 0.85em; font-weight: bold; }
.wyl-archive-card-body { padding: 16px; flex: 1; display: flex; flex-direction: column; }
.wyl-archive-card-title { font-size: 1.2em; margin-bottom: 6px; color: var(--wyl-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wyl-archive-card-alias { font-style: italic; color: var(--wyl-light-text); font-size: 0.9em; margin-bottom: 8px; }
.wyl-archive-card-meta { display: flex; justify-content: space-between; margin-top: auto; font-size: 0.85em; color: var(--wyl-light-text); }
.wyl-archive-card-cats { background: #f0e6d2; padding: 2px 8px; border-radius: 10px; }

.wyl-archive-pagination { text-align: center; margin-top: 20px; }
.wyl-archive-pagination .page-numbers { display: inline-block; padding: 6px 14px; margin: 0 3px; background: #fff; border: 1px solid #ddd; border-radius: 6px; text-decoration: none; color: var(--wyl-text); }
.wyl-archive-pagination .page-numbers.current { background: var(--wyl-primary); color: #fff; }

/* ==================== 正文页 ==================== */
.wyl-single-container { display: flex; gap: 30px; align-items: flex-start; }
.wyl-single-content {
    flex: 1 1 75%;
    min-width: 0;
    background: var(--wyl-card-bg);
    border-radius: var(--wyl-radius);
    padding: 30px;
    box-shadow: var(--wyl-shadow);
}
.wyl-article { margin: 0; padding: 0; background: transparent; box-shadow: none; border-radius: 0; }
.wyl-single-sidebar { flex: 0 0 250px; position: sticky; top: 20px; }

/* 顶部左右布局 */
.wyl-entry-top { display: flex; gap: 30px; margin-bottom: 25px; align-items: flex-start; }
.wyl-entry-thumb { flex: 0 0 40%; max-width: 40%; }
.wyl-entry-thumb img { width: 100%; height: auto; border-radius: 12px; box-shadow: var(--wyl-shadow); }
.wyl-no-thumb { width: 100%; height: 250px; background: #f0e6d2; display: flex; align-items: center; justify-content: center; border-radius: 12px; color: #999; font-size: 1.2em; }
.wyl-entry-info { flex: 1; }
.wyl-entry-title { font-size: 2.2em; color: var(--wyl-text); margin-bottom: 8px; }

/* 能力属性（标题后内联） */
.wyl-title-abilities {
    font-size: 0.6em; font-weight: normal; margin-left: 10px; white-space: nowrap;
}
.wyl-title-ability {
    color: var(--wyl-primary); text-decoration: none; background: none;
    padding: 0; margin: 0 5px 0 0; font-size: inherit; border-bottom: 1px dotted var(--wyl-primary);
}
.wyl-title-ability:hover { border-bottom: 1px solid var(--wyl-primary); }

.wyl-entry-alias { font-style: italic; color: var(--wyl-light-text); margin-bottom: 12px; }

/* 属性网格 */
.wyl-entry-props {
    display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px;
    background: #f9f6f0; padding: 15px; border-radius: 8px; margin-bottom: 15px;
}
.wyl-prop-item { text-align: center; }
.wyl-prop-label { display: block; font-size: 0.85em; color: var(--wyl-text); margin-bottom: 4px; }
.wyl-prop-value { font-weight: bold; color: var(--wyl-primary); }

/* 扩展信息列表 */
.wyl-entry-details {
    list-style: none; padding: 0; margin: 0; background: #faf7f0; border-radius: 8px; padding: 12px 15px;
}
.wyl-entry-details li { display: flex; padding: 8px 0; border-bottom: 1px dashed #e5d9c5; }
.wyl-entry-details li:last-child { border-bottom: none; }
.wyl-detail-label { font-weight: bold; color: var(--wyl-text); min-width: 80px; margin-right: 10px; }
.wyl-detail-value { color: var(--wyl-light-text); }

/* 二级标签条 */
.wyl-taxonomy-tags {
    display: flex; flex-wrap: wrap; gap: 15px 30px; margin: 20px 0;
    padding: 12px 15px; background: #faf7f0; border-radius: 8px; font-size: 0.9em;
}
.wyl-tax-row { white-space: nowrap; }
.wyl-tax-label { font-weight: bold; color: var(--wyl-text); margin-right: 5px; }

.wyl-rich-content { line-height: 1.8; }

/* 文献折叠 */
.wyl-literature-item {
    border: 1px solid var(--wyl-border); border-radius: 8px; margin-bottom: 12px; overflow: hidden;
}
.wyl-lit-header {
    background: #f9f6f0; padding: 12px 15px; cursor: pointer; display: flex; align-items: center;
    user-select: none;
}
.wyl-lit-toggle { margin-right: 10px; font-size: 0.8em; color: var(--wyl-primary); }
.wyl-lit-dynasty { margin-left: 8px; color: var(--wyl-light-text); font-weight: normal; }
.wyl-lit-body { padding: 15px; background: #fff; }

/* 文章导航 */
.wyl-post-nav {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
    margin: 40px 0 20px;
    padding: 15px 0;
    border-top: 2px solid var(--wyl-border);
    border-bottom: 2px solid var(--wyl-border);
}
.wyl-post-nav a {
    display: inline-flex;
    align-items: center;
    flex: 1 1 auto;
    min-width: 0;
    padding: 10px 18px;
    background: #f9f6f0;
    border: 1px solid var(--wyl-border);
    border-radius: 8px;
    color: var(--wyl-text);
    text-decoration: none;
    font-weight: 500;
    transition: background 0.2s, border-color 0.2s;
    word-break: break-word;
    white-space: normal;
}
.wyl-post-nav a:hover {
    background: #f0e6d2;
    border-color: var(--wyl-gold);
    color: var(--wyl-primary);
}
.wyl-nav-arrow {
    font-size: 1.2em;
    margin: 0 8px;
    flex-shrink: 0;
}

/* 相关妖怪 */
.wyl-related { margin-top: 30px; }
.wyl-related-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.wyl-related-item {
    text-align: center; text-decoration: none; color: var(--wyl-text); transition: transform 0.2s;
}
.wyl-related-item:hover { transform: translateY(-3px); }
.wyl-related-item img { width: 100%; height: 100px; object-fit: cover; border-radius: 8px; }

/* 目录 */
.wyl-toc {
    background: var(--wyl-card-bg); border-radius: var(--wyl-radius);
    padding: 20px; box-shadow: var(--wyl-shadow);
}
.wyl-toc-title { font-size: 1.2em; margin-bottom: 12px; color: var(--wyl-primary); }
#wyl-toc-nav a {
    display: block; padding: 5px 0; color: var(--wyl-text); text-decoration: none;
    font-size: 0.9em; border-bottom: 1px solid #eee;
}
#wyl-toc-nav a:hover { color: var(--wyl-primary); }

/* 评论标签 */
.wyl-comment-tag { display: inline-block; font-size: 0.8em; padding: 2px 8px; border-radius: 10px; margin-right: 8px; vertical-align: middle; }
.tag-supplement { background: #e3f2fd; color: #1565c0; }
.tag-different  { background: #fce4ec; color: #c62828; }

/* 通用卡片 */
.wyl-card { background: #fff; border-radius: var(--wyl-radius); padding: 20px; box-shadow: var(--wyl-shadow); margin-bottom: 20px; }

/* ==================== 响应式 ==================== */
@media (max-width: 1024px) {
    .wyl-homepage { flex-direction: column; }
    .wyl-home-main { flex: 1 1 100%; }
    .wyl-home-sidebar { width: 100%; flex: 0 0 auto; position: static; order: -1; }
    .wyl-category-grid { grid-template-columns: repeat(2, 1fr); }
    .wyl-tools-grid { grid-template-columns: repeat(2, 1fr); }
    .wyl-home-features { flex-direction: column; }
    .wyl-archive-container { flex-direction: column; }
    .wyl-archive-sidebar { width: 100%; position: static; order: -1; }
    .wyl-single-container { flex-direction: column; }
    .wyl-single-sidebar { width: 100%; position: static; order: -1; margin-bottom: 20px; }
    .wyl-related-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .wyl-entry-top { flex-direction: column; }
    .wyl-entry-thumb { max-width: 100%; flex: 0 0 100%; }
    .wyl-entry-props { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
    .wyl-category-grid { grid-template-columns: 1fr; }
    .wyl-tools-grid { grid-template-columns: 1fr; }
    .wyl-archive-grid { grid-template-columns: 1fr; }
    .wyl-post-nav { flex-direction: column; }
}
@media (max-width: 480px) {
    .wyl-entry-props { grid-template-columns: 1fr; }
}
/* 修复富文本区域样式，防止嵌套div破坏可读性 */
.wyl-rich-content { line-height: 1.9; font-size: 1.02em; }
.wyl-rich-content h3, .wyl-rich-content strong { color: #5C0000; }
.wyl-rich-content div { margin-bottom: 12px; }
.wyl-rich-content br + br { display: none; } /* 防止空行过多 */

/* 文献原文/译文清晰区分 */
.wyl-lit-original, .wyl-lit-translation, .wyl-lit-summary { margin-bottom: 15px; }