/* cocobook-i18n：语言切换「中文 | English」（样式 A）。沿用许可角标 B2 的尺寸和底色；状态用底色和形状表示，不用彩色边线。 */
.cb-lx { position: relative; display: inline-flex; flex-direction: column; align-items: flex-end; font-weight: 400; }
.cb-lx-seg { display: inline-flex; align-items: center; height: 24px; padding: 2px; box-sizing: border-box; border-radius: var(--cb-radius-pill, 999px);
  background: var(--cb-well, #f0f0f0); font-size: 12px; line-height: 20px; }
.cb-lx-opt { display: inline-flex; align-items: center; height: 20px; padding: 0 9px; border-radius: var(--cb-radius-pill, 999px); white-space: nowrap;
  color: var(--cb-muted, #888) !important; text-decoration: none !important; border: 0 !important; background: none; transition: color .15s ease, background-color .15s ease; }
a.cb-lx-opt:hover, a.cb-lx-opt:focus-visible { color: var(--cb-ink, #4a4a4a) !important; background: var(--cb-line, #e8e8e8); }
.cb-lx-opt.is-on { background: var(--cb-paper, #fff); color: var(--cb-ink, #4a4a4a) !important; box-shadow: 0 1px 2px rgba(0, 0, 0, .06); }
/* 没有对应页时的说明：桌面在切换下方浮出（悬停/聚焦时），不挡正文 */
.cb-lx-note { display: none; position: absolute; top: 30px; right: 0; z-index: 6; width: 220px; padding: 8px 10px; border-radius: var(--cb-radius-sm, 8px);
  background: var(--cb-paper, #fff); box-shadow: 0 6px 24px rgba(0, 0, 0, .08), 0 1px 3px rgba(0, 0, 0, .06); font-size: 12px; line-height: 1.6;
  color: var(--cb-muted, #888); text-align: left; white-space: normal; }
.cb-lx:hover .cb-lx-note, .cb-lx:focus-within .cb-lx-note { display: block; }

/* 书籍页：和许可角标并排放在标题框右上角 */
.cb-lx-corner { position: absolute; top: 16px; right: 16px; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.cb-lx-corner > * { flex: none; }
.cb-lx-corner .cb-lic-b2 { position: static; }

/* 页面：标题右侧 */
.cb-lx-page { float: right; margin: 6px 0 8px 16px; position: relative; z-index: 5; }
.page-content .cb-lx-page a.cb-lx-opt { text-decoration: none !important; }

@media (max-width: 640px) {
  .cb-lx-corner { position: static; grid-column: 1 / -1; justify-content: flex-start; margin: 0; }
  .cb-lx-page { float: none; margin: 0 0 10px; }
  .cb-lx { align-items: flex-start; }
  .cb-lx-note { display: block; position: static; width: auto; margin-top: 6px; padding: 0; box-shadow: none; background: none; }
}

html.cb-dark .cb-lx-seg { background: rgba(255, 255, 255, .07); }
html.cb-dark .cb-lx-opt.is-on { background: rgba(255, 255, 255, .14); color: #e4e4e7 !important; box-shadow: none; }
html.cb-dark a.cb-lx-opt:hover, html.cb-dark a.cb-lx-opt:focus-visible { background: rgba(255, 255, 255, .1); color: #e4e4e7 !important; }
html.cb-dark .cb-lx-note { background: #1c1c1f; box-shadow: 0 6px 24px rgba(0, 0, 0, .4); }
@media (max-width: 640px) { html.cb-dark .cb-lx-note { background: none; box-shadow: none; } }
@media print { .cb-lx, .cb-lx-corner > .cb-lx { display: none !important; } .cb-lx-corner { position: static; } }
