/* 语文教科书·三年级上册 目录页 —— 复用 index.css 的卡片 / 单元块风格 */
body {
    background-color: #FFF9F0;
}

/* 锚点定位时避开页面顶部固定导航栏 */
.unit-block {
    scroll-margin-top: 76px;
}

/* ===== 单元标题（详情页不再使用，样式从 index.css 迁入，仅供目录页） ===== */
.unit-title {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.4rem 0.8rem;
    font-size: 1.0rem;
    font-weight: 550;
    color: var(--ink);
    margin: 0;
    padding: 0.55rem 0 0.5rem;
    border-bottom: 2px solid var(--coral);
}

.unit-title .unit-theme {
    font-size: 0.95rem;   /* 与 .unit-type（阅读策略单元）同字号 */
    font-weight: 600;
    color: var(--coral-deep);
    background: #ffffff;
    border: 1px solid var(--coral-soft);
    border-radius: 999px;
    padding: 0.05rem 0.7rem;
    white-space: nowrap;
}

/* ===== 单元标题补充样式 ===== */
.unit-title .unit-type {
    font-size: 0.95rem;
    font-weight: 500;
    color: #8a5a00;
    background: #fff5e6;
    border: 1px solid #f6d9a0;
    border-radius: 999px;
    padding: 0.05rem 0.7rem;
}

/* ===== 目录列表 ===== */
.toc-list {
    display: flex;
    flex-direction: column;
}

.toc-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.3rem 0.6rem;
    padding: 0.6rem 1.1rem;
    border-top: 1px solid #f1f3f5;
    color: inherit;
    text-decoration: none;
    transition: background-color 0.15s ease;
}

.toc-item:first-child {
    border-top: none;
}

@media (hover: hover) {
    .toc-item:hover {
        background-color: var(--coral-softer);
        text-decoration: none;
    }
}

/* 课次序号：不再用高饱和红底白字（每屏十几个红块太抢眼），
   弱化为暖米底 + 暖灰数字的索引标记，保持可扫读但不与课文名争视线 */
.toc-no {
    flex: 0 0 auto;
    min-width: 2rem;
    text-align: center;
    font-size: 0.78rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: #6E6A64;
    background: var(--line-soft);
    border-radius: 4px;
    padding: 0.05rem 0.4rem;
}

/* 语文园地不是课文序号：去掉底色，只留浅暖灰文字，层级再降一档 */
.toc-no-garden {
    color: #9C948A;
    background: transparent;
}

.toc-name {
    font-size: 1.02rem;
    font-weight: 600;
    color: #262626;
}

@media (hover: hover) {
    .toc-item:hover .toc-name {
        color: #D93E3E;
    }
}

.toc-item.is-garden .toc-name {
    color: #6E6A64;
    font-weight: 500;
}

/* 略读标记：与后面的 [识字 n][写字 n][词语 n] 计数胶囊同款
   —— 同字号 / 同胶囊形 / 同内边距 / 同字重，只保留暖橙调区分语义 */
.toc-badge {
    font-size: 0.72rem;
    color: #8A5A00;
    background: #FBEED3;
    border-radius: 999px;
    padding: 0.05rem 0.5rem;
    white-space: nowrap;
}

/* 三表的条目数 */
.toc-counts {
    margin-left: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.toc-count {
    font-size: 0.72rem;
    border-radius: 999px;
    padding: 0.05rem 0.5rem;
    white-space: nowrap;
}

.toc-count.c-zi { background: #e8f2fd; color: #C23434; }
.toc-count.c-xie { background: #e8f6ec; color: #2f7a45; }
.toc-count.c-ci { background: #fdf3e0; color: #92620c; }

/* 课本页码 */
.toc-page {
    min-width: 2.6rem;
    text-align: right;
    font-size: 0.8rem;
    color: #9C948A;
}

.toc-arrow {
    font-size: 0.8rem;
    color: #E0D2BC;
}

@media (hover: hover) {
    .toc-item:hover .toc-arrow {
        color: #D93E3E;
    }
}

/* ===== 加载 / 失败占位 ===== */
.toc-loading,
.toc-error {
    padding: 2.5rem 1rem;
    text-align: center;
    font-size: 0.95rem;
    color: #9C948A;
}

.toc-error {
    color: #dc3545;
}

/* ===== 宽屏：目录项两列卡片 ===== */
@media (min-width: 900px) {
    .toc-list {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 0.75rem;
        row-gap: 0.5rem;
        padding: 0.7rem 1.1rem 0.9rem;
    }

    .toc-list .toc-item,
    .toc-list .toc-item:first-child {
        border: 1px solid var(--line);
        border-radius: 10px;
        background: #ffffff;   /* 与窄屏一致：不用米色底，保持白底 */
        padding: 0.6rem 0.8rem;
    }

    @media (hover: hover) {
        .toc-list .toc-item:hover {
            background: var(--coral-softer);
            border-color: var(--coral-soft);
        }
    }
}

/* ===== 响应式 ===== */
@media (max-width: 760px) {
    .toc-item {
        padding: 0.55rem 0.85rem;
    }

    .toc-name {
        font-size: 1rem;
    }

    .toc-counts {
        margin-left: 0;
    }

    .toc-page {
        margin-left: auto;
    }

    .toc-arrow {
        display: none;
    }

    .unit-title {
        font-size: 1.05rem;
        padding: 0.45rem 0 0.4rem;
    }
}
