/**
 * [INPUT]: 依赖 style1.css 提供的全站基础排版与 .site-header/.breadcrumbs
 * [OUTPUT]: 对外提供 .cx-* 内容组件样式（文章骨架、折叠提示、答案、目录、表格、生成器工具）
 * [POS]: 内容型页面的共享样式——每日提示生成页、词表 / 生成器 / 同类游戏页、博客文章都加载它；首页游戏不加载
 * [PROTOCOL]: 变更时更新此头部，然后检查 CLAUDE.md
 */

/* ============================================================
   色板：四档难度色
   ============================================================ */
.cx {
    --cx-yellow: #f6d860;
    --cx-green: #9ccc65;
    --cx-blue: #a6c1ee;
    --cx-purple: #c19be0;
    --cx-ink: #13141c;
    --cx-muted: #5c6070;
    --cx-line: #e3e4ea;
    --cx-accent: #5b1b89;
    background: #fff;
    color: var(--cx-ink);
}

.cx-group--yellow, .cx-answer--yellow, .cx-chip--yellow { --cx-c: var(--cx-yellow); }
.cx-group--green, .cx-answer--green, .cx-chip--green { --cx-c: var(--cx-green); }
.cx-group--blue, .cx-answer--blue, .cx-chip--blue { --cx-c: var(--cx-blue); }
.cx-group--purple, .cx-answer--purple, .cx-chip--purple { --cx-c: var(--cx-purple); }

/* ============================================================
   文章骨架
   ============================================================ */
.cx-article {
    max-width: 760px;
    margin: 0 auto;
    padding: 24px 16px 48px;
    font-size: 17px;
    line-height: 1.6;
}

.cx-article h1 {
    margin: 8px 0 16px;
    font-size: 30px;
    line-height: 1.25;
}

.cx-article h2 {
    margin: 0 0 12px;
    font-size: 22px;
}

.cx-article h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 8px;
    font-size: 18px;
}

.cx-article a {
    color: var(--cx-accent);
}

/* style1.css 全局把 ul 居中，提示页正文列表需左对齐 */
.cx ul {
    text-align: left;
}

.cx-lead {
    font-size: 18px;
}

.cx-meta {
    color: var(--cx-muted);
}

.cx-rating {
    margin-right: 6px;
    color: var(--cx-accent);
    font-weight: 700;
    letter-spacing: 1px;
}

.cx-section {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--cx-line);
}

/* ============================================================
   折叠提示：逐级展开，防剧透
   ============================================================ */
.cx details {
    margin: 8px 0;
    border: 1px solid var(--cx-line);
    border-radius: 8px;
    background: #fafafc;
}

.cx summary {
    padding: 10px 14px;
    cursor: pointer;
    font-weight: 600;
}

.cx details[open] > summary {
    border-bottom: 1px solid var(--cx-line);
}

.cx details > :not(summary) {
    margin: 12px 14px;
}

.cx-group {
    margin: 16px 0;
    padding: 12px 14px;
    border-left: 6px solid var(--cx-c);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(19, 20, 28, 0.08);
}

.cx-dot {
    width: 14px;
    height: 14px;
    flex: none;
    border-radius: 50%;
    background: var(--cx-c);
}

.cx-chips {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0;
    list-style: none;
}

.cx-chip {
    padding: 8px 12px;
    border-radius: 6px;
    background: var(--cx-c);
    font-weight: 600;
}

/* ============================================================
   答案区
   ============================================================ */
.cx-reveal > summary {
    background: var(--cx-accent);
    color: #fff;
    border-radius: 8px;
}

.cx-reveal[open] > summary {
    border-radius: 8px 8px 0 0;
}

.cx-answer {
    padding: 12px 14px;
    border-radius: 8px;
    background: color-mix(in srgb, var(--cx-c) 28%, #fff);
}

.cx-answer h3 {
    margin-bottom: 4px;
}

.cx-words {
    margin: 0 0 8px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.cx-answer ul {
    margin: 8px 0 0;
    padding-left: 20px;
}

.cx-list {
    padding-left: 20px;
}

.cx-list li {
    margin: 4px 0;
}

/* ============================================================
   内容页组件：目录、数据表、生成器
   ============================================================ */
.cx-toc {
    margin: 24px 0;
    padding: 14px 20px;
    border-radius: 8px;
    background: #f4f5f7;
}

.cx-toc ul {
    margin: 8px 0 0;
    padding-left: 20px;
}

/* 提示页的跳转导航：横排，免得把第一条提示挤出首屏 */
.cx-toc--inline ul {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    padding-left: 0;
    list-style: none;
}

.cx-table {
    width: 100%;
    margin: 12px 0 20px;
    border-collapse: collapse;
    font-size: 15px;
}

/* 每日页"一览表"：题号 / 日期 / 编辑 / 难度 / 下一题，承接事实型查询 */
.cx-facts caption {
    margin-bottom: 4px;
    font-weight: 700;
    text-align: left;
}

.cx-facts th {
    width: 32%;
    color: var(--cx-muted);
    font-weight: 600;
}

.cx-table th,
.cx-table td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--cx-line);
    text-align: left;
    vertical-align: top;
}

.cx-table thead th {
    background: #f4f5f7;
}

.cx-table tbody th {
    white-space: nowrap;
}

.cx-tool {
    margin: 24px 0;
    padding: 20px;
    border: 2px solid var(--cx-purple);
    border-radius: 12px;
    text-align: center;
}

.cx-tool button {
    cursor: pointer;
    font: inherit;
}

.cx-tool__levels {
    display: inline-flex;
    gap: 6px;
}

.cx-tool__levels button {
    padding: 6px 14px;
    border: 1px solid var(--cx-line);
    border-radius: 999px;
    background: #fff;
}

.cx-tool__levels button[aria-pressed="true"] {
    border-color: var(--cx-accent);
    background: var(--cx-accent);
    color: #fff;
}

.cx-tool__word {
    margin: 18px 0 14px;
    font-size: 40px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    overflow-wrap: anywhere;
}

.cx-tool__links {
    min-height: 48px;
    margin: 16px 0;
}

.cx-tool__links p {
    margin: 0 0 8px;
    color: var(--cx-muted);
}

.cx-tool__chip {
    display: inline-block;
    margin: 4px;
    padding: 6px 12px;
    border: 0;
    border-radius: 6px;
    background: color-mix(in srgb, var(--cx-blue) 45%, #fff);
}

button.cx-tool__chip {
    text-decoration: underline;
}

.cx-tool__lookup {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
}

.cx-tool__lookup label {
    width: 100%;
    font-weight: 600;
}

.cx-tool__lookup input {
    padding: 8px 12px;
    border: 1px solid var(--cx-line);
    border-radius: 6px;
    font: inherit;
}

.cx-tool__lookup button {
    padding: 8px 16px;
    border: 0;
    border-radius: 6px;
    background: var(--cx-accent);
    color: #fff;
}

/* ============================================================
   回流入口与翻页
   ============================================================ */
.cx-cta {
    margin-top: 32px;
    padding: 18px;
    border: 2px solid var(--cx-purple);
    border-radius: 10px;
    text-align: center;
}

.cx-cta p {
    margin: 0 0 12px;
}

.cx-cta__btn {
    display: inline-block;
    padding: 10px 22px;
    border-radius: 999px;
    background: var(--cx-accent);
    color: #fff !important;
    font-weight: 700;
    text-decoration: none;
}

.cx-pager {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
    margin-top: 24px;
    font-weight: 600;
}

@media (max-width: 768px) {
    .cx-article {
        font-size: 16px;
    }

    .cx-article h1 {
        font-size: 24px;
    }

    .cx-pager {
        flex-direction: column;
    }

    .cx-table {
        font-size: 14px;
    }

    .cx-table tbody th {
        white-space: normal;
    }

    .cx-tool__word {
        font-size: 30px;
    }
}
