
.mce-i-c-svg.zib-douban svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* TinyMCE 按钮图标（无内联样式） */
.zib-douban-icon {
    width: 20px;
    height: 20px;
    fill: currentColor;
    display: inline-block;
}

/* 弹窗顶部搜索区 - 精简重构（仅作用于本插件弹窗） */
.douban-dialog .douban-search-modal { padding: 6px 8px; align-items: center; }
.douban-dialog .douban-search-header { display: flex; align-items: center; justify-content: flex-start; padding: 2px 0; border-bottom: 1px solid #edf1f5; width: 100%; margin-bottom: 4px; flex: 0 0 auto; }
.douban-dialog .douban-search-input-wrap { position: relative; width: 100%; display: block; }
.douban-dialog .douban-search-input { width: 100%; max-width: none; height: 36px; padding: 0 36px 0 12px; border: 1.5px solid #e5e7eb; border-radius: 10px; font-size: 14px; background: #fff; color: #222; box-shadow: 0 2px 8px rgba(0,0,0,0.04); transition: all .2s; }
.douban-dialog .douban-search-input { box-sizing: border-box; }
.douban-dialog .douban-search-root, .douban-dialog .douban-search-root * { box-sizing: border-box !important; }
.douban-dialog .douban-search-input-wrap { max-width: 100% !important; }
.douban-dialog .douban-search-input:hover { border-color: #d0d0d0; box-shadow: 0 3px 12px rgba(0,0,0,.06); }
.douban-dialog .douban-search-input:focus { outline: none; border-color: #00b51d; box-shadow: 0 0 0 3px rgba(0,181,29,.14), 0 3px 12px rgba(0,0,0,.06); }
.douban-dialog .douban-search-input::placeholder { color: #9aa0a6; }
.douban-dialog .douban-search-clear { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 24px; height: 24px; display: none; align-items: center; justify-content: center; border-radius: 6px; border: 1px solid #e5e7eb; background: #f7f7f8; color: #9aa0a6; cursor: pointer; line-height: 1; font-size: 16px; }
.douban-dialog .douban-search-clear:hover { background: #f0f2f5; color: #4b5563; }
.douban-dialog .douban-search-results { max-height: 360px; overflow-y: auto; margin: 0; padding: 0; }
.douban-search-loading { display: none; text-align: center; padding: 15px; color: #666; font-size: 12px; }
.douban-search-error { display: none; text-align: center; padding: 15px; color: #ff4d4f; font-size: 12px; }

/* 结果项 */
.douban-result-item { display: grid !important; grid-template-columns: 60px 1fr !important; align-items: stretch !important; padding: 12px 14px; margin: 0 !important; border: 1px solid #eef2f7; border-radius: 0; cursor: pointer; background: #fff; transition: box-shadow .2s ease, border-color .2s ease, background-color .2s ease; column-gap: 10px; min-height: 84px; overflow: hidden; box-shadow: 0 1px 4px rgba(17,24,39,.06); width: 100%; }
.douban-dialog .douban-result-item * { border-radius: 0 !important; }
.douban-result-item:hover { background: #f9fafb; border-color: #e5e7eb; box-shadow: 0 4px 12px rgba(17,24,39,.10); }
.douban-result-item:active { transform: translateY(0); box-shadow: none; }
.douban-result-item.active{ background:#f9fafb; border-color:#d1fae5 !important; box-shadow: 0 0 0 3px rgba(5,150,105,.10); }
.douban-result-thumb { width: 60px; height: 100%; min-width: 60px; max-width: 60px; min-height: 84px; max-height: none; border-radius: 0; overflow: hidden; flex-shrink: 0 !important; flex-grow: 0 !important; background: #f6f7fb; border: 1px solid #e8edf5; box-shadow: 0 1px 2px rgba(0,0,0,0.04); position: relative; background-image: linear-gradient(90deg,#eff3f8 0%,#f7f9fc 50%,#eff3f8 100%); background-size:200% 100%; animation: doubanShimmer 1.2s linear infinite; }
.douban-result-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; transition: opacity .2s ease; }
.douban-result-thumb.is-loaded { animation: none; background-image: none; }
.douban-result-thumb.is-loaded img { opacity: 1; }
.douban-result-thumb img:not(.hidden) { display: block !important; }
.douban-result-thumb img.hidden { display: none !important; }
.hidden { display: none !important; }
.douban-result-content { flex: 1 !important; min-width: 0; display: block !important; }
.douban-result-title { font-size: 14px; color: #111827; overflow: hidden; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.45; white-space: normal; }
.douban-result-year { font-size: 12px; color: #999; margin-top: 2px; }

/* 小徽章 */
.douban-badge { display: inline; background: transparent; color: #6b7280; border-radius: 0; font-size: 12px; padding: 0; margin-left: 6px; line-height: 1.2; height: auto; border: 0; }

@keyframes doubanShimmer { 0%{ background-position:-200% 0 } 100%{ background-position:200% 0 } }

/* ========== TinyMCE 弹窗整体美化（作用于本插件窗口） ========== */
.douban-dialog { border: 0 !important; border-radius: 14px !important; overflow: hidden !important; box-shadow: 0 18px 48px rgba(17,24,39,.16), 0 8px 24px rgba(17,24,39,.08) !important; background: #fff !important; max-height: 90vh !important; position: fixed !important; left: 50% !important; top: 50% !important; transform: translate(-50%,-50%) !important; margin: 0 !important; width: 380px !important; max-width: 92vw !important; height: auto !important; }
.douban-dialog .mce-window-body { max-height: calc(90vh - 100px) !important; overflow-y: hidden !important; overflow-x: hidden !important; }
.douban-dialog .mce-container-body { overflow-x: hidden !important; overflow-y: hidden !important; display: block !important; }
.douban-dialog .mce-window-head { background: linear-gradient(180deg,#f9fafb 0%,#f3f4f6 100%); border: 0; padding: 10px 12px; cursor: default !important; }
.douban-dialog .mce-dragh { display: none !important; }
.douban-dialog .mce-title { font-size: 14px; font-weight: 600; color: #111827; }
.douban-dialog .mce-close { background: transparent; border: 0; border-radius: 8px; }
.douban-dialog .mce-close:hover { background: rgba(15,23,42,.06); }
.douban-dialog .mce-window-body { background: #fff; }
.douban-dialog .douban-search-results .douban-result-item { border-color:#e5e7eb !important; border-width:1px !important; border-style:solid !important; }
.douban-dialog .douban-search-results .douban-result-item:hover { border-color:#d1d5db !important; }
.douban-dialog .mce-container-body { padding: 0 !important; }
.douban-dialog .mce-window-body,
.douban-dialog .mce-window-body .mce-form,
.douban-dialog .mce-window-body .mce-container-body { padding-left: 0 !important; padding-right: 0 !important; }
.douban-dialog .mce-foot { background: #fff; border-top: 1px solid #edf1f5 !important; padding: 8px 12px !important; display: flex !important; justify-content: flex-end !important; align-items: center !important; gap: 10px !important; box-sizing: border-box; }
.douban-dialog .mce-foot .mce-container-body { display: flex !important; justify-content: flex-end !important; align-items: center !important; gap: 10px !important; width: 100% !important; flex-wrap: nowrap !important; }
.douban-dialog .mce-foot .mce-abs-layout-item { position: static !important; left: auto !important; top: auto !important; width: auto !important; height: auto !important; }
.douban-dialog .mce-btn { border-radius: 10px; border: 1px solid #e5e7eb; background: #f7f7f8; box-shadow: 0 2px 8px rgba(17,24,39,.06); transition: all .2s ease; }
.douban-dialog .mce-foot .mce-btn { margin: 0 !important; line-height: 1.2 !important; }
.douban-dialog .mce-btn .mce-txt { color: #111827; font-weight: 600; }
.douban-dialog .mce-btn:hover { background: #f0f2f5; transform: translateY(-1px); }
.douban-dialog .mce-primary { border: 0; background: linear-gradient(135deg,#00b51d,#059669) !important; box-shadow: 0 6px 16px rgba(5,150,105,.28) !important; }
.douban-dialog .mce-primary .mce-txt { color: #fff; }
.douban-dialog .mce-primary:hover { filter: brightness(1.03); transform: translateY(-1px); }

.douban-dialog .douban-search-root { display: flex !important; flex-direction: column; box-sizing: border-box; width: 100%; min-height: 0; }
.douban-dialog .douban-search-modal { display: flex; flex-direction: column; gap: 6px; box-sizing: border-box; width: 100%; min-height: 0; flex: 0 0 auto; }
.douban-dialog .douban-search-results { border-top: 0; margin: 4px 0 0; padding: 0 8px var(--douban-foot-space, 64px); overflow-y: auto; display: flex !important; flex-direction: column; align-items: stretch; gap: 2px; background: transparent; width: 100%; min-height: 0; max-height: calc(90vh - 200px); scrollbar-gutter: stable; overscroll-behavior: contain; position: relative; box-sizing: border-box; }
.douban-dialog .douban-search-results > .douban-result-item { margin: 0 !important; width: 100%; max-width: none; }
.douban-dialog .douban-search-results > .douban-result-item + .douban-result-item { margin-top: 2px !important; }
.douban-dialog .douban-search-results .douban-result-item:last-child { margin-bottom: 0; }
.douban-dialog .douban-search-loading, .douban-dialog .douban-search-error { margin-top: 6px; }

/* 兼容 TinyMCE 的 abs 布局，防止内容区高度被强制固定 - 终极加强版 */
.douban-dialog .mce-window-body,
.douban-dialog .mce-window-body *[class*="mce-"] { box-sizing: border-box !important; }

/* 恢复必要的绝对布局覆盖，避免内容层叠挤在一行 */
.douban-dialog .mce-window-body .mce-container-body .mce-form.mce-abs-layout-item,
.douban-dialog .mce-window-body .mce-container-body .mce-abs-layout-item,
.douban-dialog .mce-window-body .mce-container-body .mce-abs-layout,
.douban-dialog .mce-window-body .mce-container-body .mce-container {
  position: static !important;
  display: block !important;
  left: auto !important;
  right: auto !important;
  top: auto !important;
  bottom: auto !important;
  float: none !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
}
.douban-dialog .mce-window-body .mce-container-body {
  display: block !important;
  position: static !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
}

/* 修复 TinyMCE 内层容器固定高度（常见为 16px）导致内容被挤压 */
.douban-dialog .mce-window-body .mce-container-body[style],
.douban-dialog .mce-container-body > div[style] { height: auto !important; min-height: 0 !important; }
