/**
 * 古诗词频道：入口卡片、详情正文、分页。
 * 用于 /gushici/ 及唐诗宋词诗人页；频道头样式沿用 page.css 的 .channel-head。
 */

/* 频道入口：紧凑小方块；手机 2 列，Pad 4 列，桌面 5–6 列 */
.gsc-entries {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 8px auto 28px;
}

.gsc-entry {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 64px;
    padding: 10px 8px;
    border: 1px solid var(--line);
    background: var(--paper-2);
    color: inherit;
    text-decoration: none;
    text-align: center;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.3;
}

.gsc-entry span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 400;
    line-height: 1.3;
}

.gsc-entry:hover {
    border-color: var(--azurite);
    color: var(--azurite);
}

/* 四书五经：暂未收录的经目（如易经） */
.gsc-entry--pending {
    cursor: default;
    color: var(--muted);
}

.gsc-entry--pending:hover {
    border-color: var(--line);
    color: var(--muted);
}

/* 古诗词·百家姓韵文详情：查百科姓氏 */
.gsc-bjx-search {
    margin: 8px auto 0;
    max-width: 640px;
}

.gsc-bjx-search__hint {
    margin-bottom: 8px;
}

.bjx-search-miss {
    color: var(--cinnabar);
    text-align: center;
}

/* 「随便看看」与列表区上下留白 */
.gsc-home-block {
    margin-bottom: 8px;
}

.gsc-cards {
    margin-bottom: 8px;
}

.gsc-cards .card p,
.gsc-card p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
}

/* 标题：比上面的 p 更具体，避免被覆盖（与成语卡 .chengyu-card .word 一致） */
.gsc-cards .card p.word,
.gsc-card p.word {
    font-family: var(--font-kai);
    font-size: 1.4rem;
    margin: 0 0 4px;
    color: var(--ink);
    line-height: 1.35;
}

.gsc-cards .card p + p,
.gsc-card p + p {
    margin-top: 6px;
}

/* 详情头：居中，间距对齐成语/词语详情 */
.gsc-detail {
    padding-top: 8px;
}

.gsc-hero {
    text-align: center;
    padding: 12px 0 8px;
}

.gsc-hero .eyebrow {
    margin-bottom: 8px;
}

.gsc-hero h1 {
    font-family: var(--font-kai);
    font-size: clamp(1.7rem, 4.2vw, 2.4rem);
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 12px;
}

/* 作者页：姓名下「共 xx 首」，居中（覆盖 .lead 左对齐） */
.gsc-hero .lead {
    text-align: center;
    margin: 0 auto;
}

/* 作者称谓（诗仙、大李杜等） */
.gsc-author-titles {
    margin: 8px auto 0;
    max-width: 40em;
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.5;
    text-align: center;
}

/* 作者页头像（古文岛同步到 /images/touxiang/） */
.gsc-hero--author {
    padding-top: 16px;
}

.gsc-author-avatar {
    display: block;
    width: 96px;
    height: 96px;
    margin: 0 auto 14px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center top;
    background: #f0ebe3;
    box-shadow: 0 0 0 3px #fff, 0 0 0 4px rgba(42, 74, 107, 0.18);
}

@media (max-width: 767px) {
    .gsc-author-avatar {
        width: 80px;
        height: 80px;
        margin-bottom: 12px;
    }
}

.gsc-meta,
.gsc-author {
    margin: 0 0 10px;
    color: var(--muted);
}

/* 详情页：语料 · 作者 与朗读图标同一行（居中） */
.gsc-author-row {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 2px 0;
    margin: 0 0 10px;
}

.gsc-author-row .gsc-author {
    margin: 0;
}

/* 古诗词详情：朗读图标（复用 speak.js） */
.btn-speak-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin-left: 12px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(42, 74, 107, 0.1);
    color: var(--azurite);
    cursor: pointer;
    flex-shrink: 0;
    vertical-align: middle;
    box-shadow: 0 0 0 1px rgba(42, 74, 107, 0.22);
    transition: color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.btn-speak-icon svg {
    width: 14px;
    height: 14px;
}

.btn-speak-icon:hover {
    color: var(--azurite-deep);
    background: rgba(42, 74, 107, 0.16);
    box-shadow: 0 0 0 1px var(--azurite);
}

.btn-speak-icon:focus-visible {
    outline: 2px solid var(--azurite);
    outline-offset: 2px;
}

/* 朗读中：柔和呼吸动画提示正在播放 */
.btn-speak-icon.is-speaking {
    color: var(--azurite-deep);
    background: rgba(42, 74, 107, 0.14);
    box-shadow: 0 0 0 1px rgba(42, 74, 107, 0.35);
    animation: gsc-speak-breathe 2.4s ease-in-out infinite;
}

@keyframes gsc-speak-breathe {
    0%,
    100% {
        opacity: 1;
        transform: scale(1);
        box-shadow: 0 0 0 1px rgba(42, 74, 107, 0.28);
    }

    50% {
        opacity: 0.72;
        transform: scale(1.05);
        box-shadow: 0 0 0 2px rgba(42, 74, 107, 0.42);
    }
}

@media (prefers-reduced-motion: reduce) {
    .btn-speak-icon.is-speaking {
        animation: none;
        opacity: 0.88;
    }
}

.gsc-author a {
    color: var(--azurite);
    text-decoration: none;
}

.gsc-author a:hover {
    text-decoration: underline;
}

/* 详情页 → 古籍白话对照：与标题同为居中（覆盖 .lead 左对齐） */
.gsc-hero .gsc-wyw-link {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.gsc-body {
    text-align: center;
    font-family: var(--font-kai);
    font-size: clamp(1.05rem, 2.5vw, 1.25rem);
    line-height: 1.95;
    padding-bottom: 8px;
}

.gsc-body p {
    margin: 0 0 6px;
}

/* 四书等书类正文：居左阅读 */
.gsc-body--prose {
    text-align: left;
}

.gsc-body--prose p {
    margin: 0 0 14px;
    text-indent: 0;
}

.gsc-body--prose .gsc-copy {
    text-align: center;
}

/* 详情页正文下方「复制全文」：比 .gsc-body p 更具体，不必 !important */
.gsc-body p.gsc-copy {
    margin: 22px 0 4px;
    font-family: var(--font-ui);
    line-height: 1;
}

.gsc-copy-btn {
    min-height: 40px;
    padding: 0 18px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    border-color: var(--line);
    color: var(--muted);
}

.gsc-copy-btn:hover {
    border-color: var(--azurite);
    color: #fff;
}

/* 花间/南唐等注释块；译文/赏析复用 */
.gsc-notes {
    margin-top: 20px;
    text-align: left;
}

.gsc-notes h2 {
    margin: 0 0 12px;
    font-size: 1.05rem;
    font-weight: 600;
    text-align: center;
}

.gsc-notes p {
    margin: 0 0 8px;
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.7;
}

/* 首页 / 朝代页筛选：类型、作者、朝代 */
.gsc-filters {
    margin: 0 auto 20px;
    display: grid;
    gap: 14px;
    padding: 16px 18px;
    background: var(--paper-2);
    border: 1px solid var(--line);
}

.gsc-filters--compact {
    padding: 12px 16px;
    margin-bottom: 12px;
}

.gsc-filter-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 8px 12px;
    padding-top: 10px;
    border-top: 1px dashed var(--line);
}

.gsc-filter-row:first-child {
    padding-top: 0;
    border-top: none;
}

.gsc-filter-label {
    flex: none;
    min-width: 3em;
    color: var(--azurite, #2c5f4a);
    font-size: 14px;
    line-height: 36px;
    font-weight: 600;
}

.gsc-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.gsc-filter-chips .filter-chip {
    min-height: 36px;
    padding: 0 12px;
    font-size: 14px;
}

@media (max-width: 767px) {
    .gsc-filters {
        padding: 12px;
        gap: 12px;
    }

    .gsc-filter-label {
        width: 100%;
        line-height: 1.4;
    }

    .gsc-filter-chips .filter-chip {
        min-height: 44px;
    }
}

/* 详情页标签（来自 guwen type → tags） */
.gsc-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin: 16px 0 0;
}

.gsc-tag {
    padding: 4px 10px;
    border: 1px solid var(--line);
    background: var(--paper-2);
    color: var(--muted);
    font-size: 13px;
    line-height: 1.4;
}

/* 可点标签链接（详情 / 标签云） */
a.gsc-tag--link {
    text-decoration: none;
    color: var(--ink);
    transition: border-color 0.15s ease, background 0.15s ease;
}

a.gsc-tag--link:hover {
    border-color: var(--accent, #8b4513);
    background: var(--paper);
}

a.gsc-tag--link span {
    margin-left: 6px;
    color: var(--muted);
    font-size: 12px;
}

/* /gushici/tag/ 标签云：手机单列流、Pad/桌面多列换行 */
.gsc-tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-start;
    padding: 8px 0 24px;
}

@media (max-width: 767px) {
    .gsc-tag-cloud {
        gap: 8px;
    }

    a.gsc-tag--link {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }
}

/* 赏析：默认折叠，避免长文撑爆首屏 */
.gsc-shangxi {
    padding: 12px 16px;
}

.gsc-shangxi > summary {
    cursor: pointer;
    list-style: none;
    text-align: center;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--ink);
    padding: 4px 0;
}

.gsc-shangxi > summary::-webkit-details-marker {
    display: none;
}

.gsc-shangxi > summary::after {
    content: "（点击展开）";
    margin-left: 6px;
    font-size: 13px;
    font-weight: 400;
    color: var(--muted);
}

.gsc-shangxi[open] > summary::after {
    content: "（点击收起）";
}

.gsc-shangxi__body {
    margin-top: 12px;
}

/* 诗人页等返回链 */
.gsc-back {
    margin: 28px 0 0;
    text-align: center;
}

.gsc-back a {
    color: var(--azurite);
    text-decoration: none;
}

.gsc-back a:hover {
    text-decoration: underline;
}

.channel-head .lead a {
    color: var(--azurite);
    text-decoration: none;
}

.channel-head .lead a:hover {
    text-decoration: underline;
}

.gsc-head-actions {
    display: flex;
    justify-content: center;
    margin: 8px 0 0;
}

/* 四书五经：四书 / 五经 两组入口 */
.gsc-book-group {
    margin-bottom: 8px;
}

.gsc-book-group .gsc-entries {
    margin-top: 0;
    margin-bottom: 28px;
}

/* 诗人页「常查」：与频道入口同网格 */
.gsc-home-block .gsc-entries {
    margin-top: 0;
}

.gsc-home-block .gsc-entry {
    min-height: 56px;
    padding: 8px 6px;
}

@media (min-width: 768px) {
    /* Pad：4 列，方块更小更密 */
    .gsc-entries {
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
        margin-bottom: 32px;
    }

    .gsc-entry {
        min-height: 72px;
        padding: 12px 10px;
        font-size: 1rem;
    }

    .gsc-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1025px) {
    /* 桌面：6 列，一屏多入口 */
    .gsc-entries {
        grid-template-columns: repeat(6, 1fr);
        gap: 10px;
    }

    .gsc-entry {
        min-height: 76px;
        padding: 12px 10px;
        font-size: 1.02rem;
    }

    .gsc-entry span {
        font-size: 12px;
    }

    .gsc-cards {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 767px) {
    /* 手机触控：高度不低于约 44px */
    .gsc-entry {
        min-height: 56px;
        padding: 10px 6px;
    }
}

/* 佚名诗人页：按诗经/蒙学/唐诗等分组 */
.gsc-yiming-group {
    margin-bottom: 28px;
}

.gsc-yiming-group .lead {
    margin-top: 0;
}

.gsc-yiming-group .more-bar span {
    color: var(--muted);
    font-size: 14px;
    white-space: nowrap;
}

/* 古诗词搜索：诗人卡片（头像 + 简介），作品列表上方 */
.gsc-search-subhead {
    margin-top: 8px;
    margin-bottom: 12px;
}

.gsc-search-subhead h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.gsc-search-subhead a {
    color: var(--azurite);
    text-decoration: none;
    font-size: 0.95rem;
    white-space: nowrap;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
}

.gsc-search-subhead a:hover {
    text-decoration: underline;
}

.gsc-search-authors {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 28px;
}

/* 横向：头像左、文案右；触控区够高 */
a.gsc-search-author {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 16px;
    min-height: 44px;
    text-align: left;
}

a.gsc-search-author .gsc-author-avatar {
    width: 72px;
    height: 72px;
    margin: 0;
    flex-shrink: 0;
}

a.gsc-search-author .word {
    margin: 0 0 4px;
    font-family: var(--font-kai);
    font-size: 1.25rem;
    font-weight: 700;
}

.gsc-search-author__body {
    flex: 1;
    min-width: 0;
}

.gsc-search-author__meta {
    margin: 0 0 6px;
    color: var(--muted);
    font-size: 0.92rem;
}

.gsc-search-author__body > p:last-child {
    margin: 0;
    color: var(--ink);
    line-height: 1.55;
    font-size: 0.95rem;
}

@media (max-width: 767px) {
    a.gsc-search-author {
        gap: 12px;
        padding: 12px;
    }

    a.gsc-search-author .gsc-author-avatar {
        width: 64px;
        height: 64px;
    }

    a.gsc-search-author .word {
        font-size: 1.15rem;
    }
}

@media (min-width: 1025px) {
    /* 桌面：多位模糊命中时两列 */
    .gsc-search-authors:has(> :nth-child(2)) {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }
}
