/* ============================================================================
   系统名称：智慧家谱平台
   开发公司：元未来科技有限公司
   程序名：ebook.css（电子谱页面样式）
   功能描述：电子谱预览页布局——顶部族谱检索选择、左侧目录、中间双页 SVG 画布、
             右侧版式设置面板。
   版本号：v1.1.0
   修订历史：
     - v1.0.0 (2026-11-10)：初始版本
     - v1.1.0 (2026-11-13)：族谱选择改为检索下拉（复用 .clan-picker 样式），
                          工具栏内输入框剔除通用 input 边框与底色
   ============================================================================ */

/* 族谱检索选择器：嵌在电子谱工具栏内独占一行，输入框沿用选择器自身样式 */
.ebook-toolbar .ebook-clan-picker { flex: 1 1 100%; }
.ebook-toolbar .clan-picker-search { max-width: 460px; }
.ebook-toolbar .clan-picker-search input {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 8px 2px;
  font-size: 13px;
}

.ebook-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  padding: 14px 18px;
  margin-bottom: 18px;
}

.ebook-toolbar select,
.ebook-toolbar input {
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .16);
  color: inherit;
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 13px;
}

.ebook-toolbar label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted, #9aa4b2);
}

.ebook-toolbar .ebook-sep {
  width: 1px;
  height: 22px;
  background: rgba(255, 255, 255, .14);
}

.ebook-summary {
  font-size: 13px;
  color: var(--muted, #9aa4b2);
}

.ebook-main {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr) 240px;
  gap: 18px;
  align-items: start;
}

@media (max-width: 1180px) {
  .ebook-main { grid-template-columns: 160px minmax(0, 1fr); }
  .ebook-side-right { grid-column: 1 / -1; }
}

@media (max-width: 820px) {
  .ebook-main { grid-template-columns: 1fr; }
}

.ebook-panel {
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 12px;
  padding: 12px 14px;
}

.ebook-panel h4 {
  margin: 0 0 10px;
  font-size: 13px;
  letter-spacing: 1px;
  color: var(--muted, #9aa4b2);
  font-weight: 600;
}

.ebook-toc-item {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
}

.ebook-toc-item:hover { background: rgba(255, 255, 255, .08); }
.ebook-toc-item em { color: var(--muted, #9aa4b2); font-style: normal; }

.ebook-stage {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.ebook-stage.single { grid-template-columns: minmax(0, 1fr); }

@media (max-width: 980px) {
  .ebook-stage { grid-template-columns: minmax(0, 1fr); }
  .ebook-stage .ebook-page:nth-child(2) { display: none; }
}

.ebook-page {
  margin: 0;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
  overflow: hidden;
}

/* 电子谱阅读交互与移动端阅读 */
#ebook-pages { touch-action: pan-y pinch-zoom; }
.ebook-toc-item.active { background: color-mix(in srgb, var(--accent, #9b5b35) 16%, transparent); color: var(--accent, #9b5b35); }
@media (max-width: 820px) {
  .ebook-main { display: flex; flex-direction: column; }
  .ebook-center { order: 0; width: 100%; }
  .ebook-side-left, .ebook-side-right { width: 100%; }
  .ebook-side-left { max-height: 34vh; overflow: auto; }
  .ebook-stage { grid-template-columns: minmax(0, 1fr) !important; }
  .ebook-stage .ebook-page:nth-child(2) { display: none; }
  .ebook-pager { position: sticky; bottom: 0; z-index: 2; flex-wrap: wrap; justify-content: center; padding: 8px; background: var(--surface-solid, #fff); }
  .ebook-toolbar { padding: 10px; gap: 8px; }
}

.ebook-svg { display: block; width: 100%; height: auto; }
.ebook-person { cursor: pointer; }
.ebook-person:hover text, .ebook-person:focus text { fill: #a52b32; }
#ebook-person-dialog { width: min(520px, 90vw); max-height: 80vh; border: 1px solid #aa9471; border-radius: 10px; padding: 24px; background: #fffdf6; color: #302b24; }
#ebook-person-dialog::backdrop { background: #0008; }
#ebook-person-dialog form { text-align: right; }
#ebook-person-dialog button { padding: 6px 16px; cursor: pointer; }
#ebook-person-dialog dt { color: #826238; margin-top: 14px; }
#ebook-person-dialog dd { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.8; }

.ebook-page figcaption {
  text-align: center;
  font-size: 12px;
  color: #6b7280;
  padding: 6px 0 8px;
  background: #f4f4f5;
}

.ebook-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.ebook-pager button {
  padding: 7px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .06);
  color: inherit;
  cursor: pointer;
  font-size: 13px;
}

.ebook-pager button:disabled { opacity: .4; cursor: not-allowed; }
.ebook-pager input {
  width: 72px;
  padding: 7px 8px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .06);
  color: inherit;
  text-align: center;
}

.ebook-indicator { font-size: 13px; color: var(--muted, #9aa4b2); min-width: 90px; text-align: center; }

.ebook-loading,
.ebook-empty {
  grid-column: 1 / -1;
  padding: 60px 10px;
  text-align: center;
  color: var(--muted, #9aa4b2);
  font-size: 14px;
}

.ebook-side-right .field { margin-bottom: 10px; display: flex; flex-direction: column; gap: 5px; }
.ebook-side-right .field label { font-size: 12px; color: var(--muted, #9aa4b2); }
.ebook-side-right .field select,
.ebook-side-right .field input {
  width: 100%;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .16);
  color: inherit;
  border-radius: 8px;
  padding: 7px 9px;
  font-size: 13px;
}

.ebook-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }

.ebook-actions button,
.ebook-actions a {
  padding: 9px 12px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .06);
  color: inherit;
  cursor: pointer;
  font-size: 13px;
  text-align: center;
  text-decoration: none;
}

.ebook-actions button.primary { background: #b8860b; border-color: #b8860b; color: #fff; }
.ebook-actions button:disabled { opacity: .5; cursor: not-allowed; }

.ebook-status {
  font-size: 12px;
  color: var(--muted, #9aa4b2);
  min-height: 18px;
  margin-top: 8px;
  line-height: 1.5;
}
