/* 实体索引页面样式 */

/* 覆盖 body 默认样式 */
body {
    max-width: 1100px;
}

/* 统计信息 */
.index-stats {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 1em;
}

/* 实体类型定义说明框 */
.entity-type-desc {
    display: flex;
    align-items: baseline;
    gap: 0.6em;
    background: #f8f5e8;
    border-left: 4px solid #b8a86a;
    border-radius: 0 6px 6px 0;
    padding: 0.75em 1em;
    margin-bottom: 1.2em;
    flex-wrap: wrap;
}
.entity-type-desc .type-label {
    font-size: 0.85em;
    flex-shrink: 0;
}
.entity-type-desc .type-marker {
    font-family: monospace;
    font-size: 0.85em;
    color: #888;
    flex-shrink: 0;
}
.entity-type-desc p {
    margin: 0;
    color: #444;
    font-size: 0.9em;
    line-height: 1.6;
}

/* 搜索过滤框 */
.entity-filter {
    position: sticky;
    top: 0;
    background: #fdfdf8;
    padding: 10px 0;
    z-index: 100;
    border-bottom: 1px solid #e6e0c0;
    margin-bottom: 1em;
}

.entity-filter input {
    width: 100%;
    max-width: 400px;
    padding: 8px 12px;
    border: 1px solid #d0c8a0;
    border-radius: 4px;
    font-size: 1em;
    font-family: "Noto Serif SC", "Source Han Serif SC", serif;
    background: #fff;
}

.entity-filter input:focus {
    outline: none;
    border-color: #8B4513;
    box-shadow: 0 0 3px rgba(139, 69, 19, 0.3);
}

/* 拼音字母导航栏 */
.pinyin-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 1.5em;
    padding: 10px 0;
    border-bottom: 1px solid #e6e0c0;
}

.pinyin-letter {
    display: inline-flex;
    align-items: baseline;
    gap: 2px;
    padding: 4px 10px;
    border: 1px solid #d0c8a0;
    border-radius: 4px;
    text-decoration: none;
    font-family: Helvetica, Arial, sans-serif;
    font-weight: 600;
    font-size: 0.95em;
    color: #5a4a2a;
    background: #fffef8;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.pinyin-letter:hover {
    background-color: #f5f0e0;
    border-color: #8B4513;
    color: #8B0000;
}

.letter-count {
    font-size: 0.7em;
    font-weight: 400;
    color: #999;
}

/* 字母分节标题 */
.letter-section {
    margin-bottom: 1em;
}

.letter-heading {
    font-family: Helvetica, Arial, sans-serif;
    font-size: 1.4em;
    font-weight: 700;
    color: #8B0000;
    border-left: 5px solid #8B0000;
    padding-left: 12px;
    margin: 1.5em 0 0.5em 0;
    scroll-margin-top: 60px;
}

/* 实体条目 */
.entity-index {
    line-height: 1.8;
}

.entity-entry {
    display: flex;
    align-items: baseline;
    padding: 6px 0;
    border-bottom: 1px solid #f0ece0;
    gap: 20px;
    scroll-margin-top: 60px;
}

.entity-entry:hover {
    background-color: rgba(139, 69, 19, 0.03);
}

/* 左侧：名称 + 别名 */
.entry-left {
    flex: 0 0 160px;
    text-align: left;
}

.canonical-name {
    font-weight: 600;
    font-size: 1.05em;
}

.alias-list {
    display: block;
    font-size: 0.78em;
    color: #999;
    margin-top: 1px;
}

.entry-count {
    font-size: 0.75em;
    color: #bbb;
    margin-left: 4px;
}

/* 右侧：章节引用 */
.entry-right {
    flex: 1;
    font-size: 0.82em;
    line-height: 1.9;
    color: #555;
}

.entry-right a {
    text-decoration: none;
}

.entry-right a:hover {
    text-decoration: underline;
}

.chapter-ref-name {
    font-weight: 500;
    color: #5a4a2a;
}

.para-ref {
    color: #8B0000;
}

.para-ref:hover {
    color: #d4af37;
}

.ref-sep {
    color: #ddd;
    margin: 0 4px;
}

/* 总览页卡片网格 */
.entity-type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin: 2em 0;
}

.entity-type-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 16px;
    border: 1px solid #e6e0c0;
    border-radius: 6px;
    background: #fffef8;
    text-decoration: none;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.entity-type-card:hover {
    border-color: #d4af37;
    box-shadow: 0 2px 8px rgba(139, 69, 19, 0.12);
}

.type-label {
    font-size: 1.3em;
    font-weight: 600;
    margin-bottom: 8px;
}

.type-count {
    font-size: 0.9em;
    color: #666;
}

.type-total {
    font-size: 0.8em;
    color: #999;
}

/* 正文中实体链接样式 */
a.entity-link {
    text-decoration: none;
    color: inherit;
}

/* 章节标题区分 */
h2 {
    margin-top: 2em;
    margin-bottom: 0.5em;
    color: #5a4a2a;
    font-size: 1.5em;
    border-bottom: 2px solid #e6e0c0;
    padding-bottom: 0.3em;
}

.section-desc {
    color: #777;
    font-size: 0.9em;
    margin-top: -0.3em;
    margin-bottom: 1.5em;
}

/* 语义关系类型标签颜色 */
.type-label.relations {
    color: #4169E1; /* 皇家蓝 - 总览 */
}

.type-label.military {
    color: #DC143C; /* 深红色 - 军事 */
}

.type-label.penalty {
    color: #8B0000; /* 深红 - 刑罚 */
}

.type-label.political {
    color: #4682B4; /* 钢青色 - 政治 */
}

.type-label.economic {
    color: #DAA520; /* 金色 - 经济 */
}

/* 语义关系卡片特殊样式 */
.entity-type-card.relations-summary {
    border: 2px solid #4169E1;
    background: linear-gradient(135deg, #f8f9ff 0%, #fffef8 100%);
}

.entity-type-card.relations-summary:hover {
    border-color: #1E90FF;
    box-shadow: 0 3px 12px rgba(65, 105, 225, 0.2);
}

/* 动词条目样式 */
.entity-name {
    font-weight: 700;
    font-size: 1.1em;
    color: #2c1810;
}

.entity-count {
    font-size: 0.8em;
    color: #999;
    margin-left: 6px;
}

.chapter-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chapter-ref {
    display: inline-block;
    padding: 2px 8px;
    background: #f5f0e0;
    border-radius: 3px;
    color: #5a4a2a;
    font-size: 0.9em;
    text-decoration: none;
    border: 1px solid #e6e0c0;
    transition: all 0.15s ease;
}

.chapter-ref:hover {
    background: #e8dfc0;
    border-color: #8B4513;
    color: #8B0000;
}

.disambiguation {
    margin-top: 6px;
    font-size: 0.85em;
    color: #888;
    font-style: italic;
}

/* 统计摘要框 */
.stats-summary {
    background: #f8f5e8;
    border: 1px solid #d0c8a0;
    border-radius: 6px;
    padding: 1.2em 1.5em;
    margin: 2em 0;
}

.stats-summary h2 {
    margin-top: 0;
    border-bottom: none;
    padding-bottom: 0;
    font-size: 1.2em;
}

.stats-summary ul {
    margin: 0.5em 0 0 1.2em;
    padding: 0;
}

.stats-summary li {
    margin: 0.3em 0;
    color: #555;
}
