/* yc-tools-v1.css — 昱辰集全站公共能力样式（预览/导出/高级编辑器）
 * 全部使用站点主题变量（--theme / --theme-rgb 等），融入现有 UI 体系。 */

/* ---------- 通用 ---------- */
.yct-overlay {
  position: fixed; inset: 0; z-index: 99990;
  background: rgba(15, 13, 8, .58);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  animation: yctFade .18s ease;
}
@keyframes yctFade { from { opacity: 0; } to { opacity: 1; } }
.yct-dialog {
  background: #fff; border-radius: 18px; overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .28);
  border: 1px solid rgba(var(--theme-rgb, 185, 146, 63), .18);
  animation: yctPop .2s ease;
}
@keyframes yctPop { from { transform: translateY(10px) scale(.985); opacity: .6; } to { transform: none; opacity: 1; } }
.yct-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px; border-bottom: 1px solid rgba(var(--theme-rgb, 185, 146, 63), .14);
  background: linear-gradient(180deg, rgba(var(--theme-rgb, 185, 146, 63), .07), rgba(255, 255, 255, 0));
  flex: 0 0 auto;
}
.yct-head-copy small { display: block; font-size: 10px; letter-spacing: .14em; color: rgba(var(--theme-rgb, 185, 146, 63), .9); font-weight: 700; }
.yct-head-copy b { font-size: 15px; color: #232015; max-width: 52vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; }
.yct-head-actions { display: flex; gap: 8px; align-items: center; flex: 0 0 auto; }
.yct-btn {
  -webkit-appearance: none; appearance: none; border: 1px solid rgba(var(--theme-rgb, 185, 146, 63), .35);
  background: #fff; color: #33302a; border-radius: 10px; padding: 7px 14px;
  font-size: 13px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 5px;
  transition: all .15s ease; line-height: 1.3; font-family: inherit;
}
.yct-btn:hover { border-color: var(--theme, #B9923F); color: var(--theme, #B9923F); background: rgba(var(--theme-rgb, 185, 146, 63), .06); }
.yct-btn.primary { background: var(--theme, #B9923F); border-color: var(--theme, #B9923F); color: var(--theme-on, #fff); font-weight: 600; }
.yct-btn.primary:hover { background: var(--theme-dark, #9a7c33); color: var(--theme-on, #fff); }
.yct-btn.small { padding: 4px 10px; font-size: 12px; border-radius: 8px; }
.yct-btn.ghost { background: transparent; }
.yct-btn i { font-style: normal; }
.yct-btn[disabled] { opacity: .55; cursor: default; }
.yct-body { flex: 1 1 auto; overflow: auto; position: relative; }
.yct-foot { flex: 0 0 auto; padding: 9px 18px; font-size: 12px; color: #8b857a; border-top: 1px solid rgba(var(--theme-rgb, 185, 146, 63), .12); background: #fbfaf7; }
.yct-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 80px 20px; color: #857f72; font-size: 14px; }
.yct-loading i { width: 30px; height: 30px; border-radius: 50%; border: 3px solid rgba(var(--theme-rgb, 185, 146, 63), .2); border-top-color: var(--theme, #B9923F); animation: yctSpin .8s linear infinite; }
@keyframes yctSpin { to { transform: rotate(360deg); } }
body.yct-locked { overflow: hidden; }
.yct-mini-toast { position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%) translateY(10px); background: #2c2a24; color: #fff; padding: 9px 18px; border-radius: 20px; font-size: 13px; opacity: 0; transition: all .25s; z-index: 100001; }
.yct-mini-toast.show { opacity: 1; transform: translateX(-50%); }

/* ---------- 预览 ---------- */
.yc-preview-dialog { width: min(1080px, 94vw); height: min(86vh, 900px); }
.yc-preview-body { background: #f4f2ec; }
.yc-pdf-scroll { padding: 18px; display: flex; flex-direction: column; gap: 14px; align-items: center; }
.yc-pdf-page { position: relative; background: #fff; border-radius: 8px; box-shadow: 0 3px 14px rgba(0, 0, 0, .1); overflow: hidden; width: 100%; max-width: 900px; }
.yc-pdf-page canvas { display: block; }
.yc-pdf-pageno { position: absolute; right: 10px; bottom: 8px; background: rgba(0, 0, 0, .55); color: #fff; font-size: 11px; padding: 2px 9px; border-radius: 10px; }
.yc-pdf-meta { font-size: 12px; color: #8b857a; }
.yc-docx-wrap { background: #eceae3; min-height: 100%; padding: 18px 6px; }
.yc-docx-wrap .docx-wrapper { background: transparent !important; padding: 10px !important; }
.yc-docx-wrap .docx { box-shadow: 0 3px 14px rgba(0, 0, 0, .12) !important; margin-bottom: 14px; }
.yc-sheet-tabs { display: flex; gap: 6px; padding: 12px 14px 0; flex-wrap: wrap; position: sticky; top: 0; background: #f4f2ec; z-index: 2; }
.yc-sheet-tabs button { border: 1px solid rgba(var(--theme-rgb, 185, 146, 63), .3); background: #fff; border-radius: 8px; padding: 5px 13px; font-size: 12px; cursor: pointer; color: #4c4638; font-family: inherit; }
.yc-sheet-tabs button.active { background: var(--theme, #B9923F); border-color: var(--theme, #B9923F); color: var(--theme-on, #fff); font-weight: 600; }
.yc-sheet-wrap { padding: 12px 14px 20px; overflow: auto; }
.yc-sheet-table { border-collapse: collapse; background: #fff; font-size: 12.5px; box-shadow: 0 2px 10px rgba(0, 0, 0, .08); border-radius: 8px; overflow: hidden; }
.yc-sheet-table td, .yc-sheet-table th { border: 1px solid #e4e0d5; padding: 5px 10px; max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.yc-sheet-table tr:first-child td { background: rgba(var(--theme-rgb, 185, 146, 63), .1); font-weight: 600; color: #4c4331; }
.yc-pptx-host { min-height: 200px; padding: 14px; }
.yc-img-wrap { display: flex; align-items: flex-start; justify-content: center; padding: 24px; min-height: 300px; overflow: auto; }
.yc-img-view { max-width: 96%; width: auto; border-radius: 8px; box-shadow: 0 4px 18px rgba(0, 0, 0, .16); transition: width .15s; }
.yc-img-zoombar { position: absolute; right: 18px; bottom: 18px; display: flex; gap: 6px; align-items: center; background: rgba(255, 255, 255, .94); border: 1px solid rgba(var(--theme-rgb, 185, 146, 63), .25); border-radius: 12px; padding: 5px 9px; box-shadow: 0 4px 14px rgba(0, 0, 0, .14); }
.yc-img-zoombar button { border: 0; background: transparent; font-size: 16px; cursor: pointer; color: #4c4638; width: 26px; height: 26px; border-radius: 7px; }
.yc-img-zoombar button:hover { background: rgba(var(--theme-rgb, 185, 146, 63), .12); }
.yc-img-zoombar span { font-size: 12px; color: #857f72; min-width: 44px; text-align: center; }
.yc-text-pre { margin: 0; padding: 20px 22px; white-space: pre-wrap; word-break: break-word; font-size: 13.5px; line-height: 1.75; color: #33302a; font-family: Consolas, "Microsoft YaHei", monospace; }
.yc-text-rich { padding: 20px 24px; background: #fff; min-height: 100%; }
.yc-legacy-note { max-width: 460px; margin: 70px auto; background: #fff; border: 1px solid rgba(var(--theme-rgb, 185, 146, 63), .25); border-radius: 14px; padding: 26px 26px 24px; text-align: center; }
.yc-legacy-note b { font-size: 15px; color: #33302a; }
.yc-legacy-note p { font-size: 13px; color: #7a7468; line-height: 1.7; margin: 10px 0 16px; text-align: left; }
.yc-preview-btn { margin-right: 8px; }

/* ---------- 导出工具条 ---------- */
.yc-export-bar {
  position: absolute; top: 10px; right: 12px; z-index: 60;
  display: flex; align-items: center; gap: 6px;
  background: rgba(255, 255, 255, .95);
  border: 1px solid rgba(var(--theme-rgb, 185, 146, 63), .3);
  border-radius: 12px; padding: 6px 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .12);
  backdrop-filter: blur(4px);
}
.yc-export-label { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; color: var(--theme, #B9923F); padding: 0 2px 0 4px; }
.yc-export-label i { font-style: normal; }
#view.yc-export-marked { position: relative; }

/* ---------- Cherry 编辑器 ---------- */
.yc-editor-dialog { width: min(1180px, 96vw); height: min(90vh, 940px); }
.yc-editor-body { padding: 0; background: #fff; }
#ycCherryHost { height: 100%; }
#ycCherryHost .cherry { height: 100%; border: 0; box-shadow: none; }
#ycCherryHost .cherry .cherry-editor, #ycCherryHost .cherry .cherry-preview { height: 100%; overflow: auto; }
#ycCherryHost .CodeMirror { height: 100% !important; font-family: Consolas, "Microsoft YaHei", monospace; }
.yc-editor-open-btn { margin: 8px 0 0; }
.yc-draft-hint { margin-left: auto; color: var(--theme, #B9923F); }

/* ---------- 移动端 ---------- */
@media (max-width: 768px) {
  .yct-overlay { padding: 0; }
  .yct-dialog { width: 100vw; height: 100vh; height: 100dvh; border-radius: 0; }
  .yct-head { padding: 12px 14px; }
  .yct-head-copy b { max-width: 42vw; font-size: 14px; }
  .yct-head-actions .yct-btn { padding: 6px 10px; font-size: 12px; }
  .yct-head-actions a.yct-btn[data-hidem], #yctPrevNewWin { display: none; }
  .yc-export-bar { top: 8px; right: 8px; padding: 4px 6px; }
  .yc-export-label { display: none; }
  .yc-editor-dialog .yct-foot { font-size: 11px; padding: 7px 12px; }
  .yc-img-zoombar { right: 10px; bottom: 12px; }
  .yct-btn.small { padding: 6px 11px; font-size: 12px; }
}
