/* 语音输入按钮：包裹普通输入框与富文本编辑区，不改变控件高度 */
.voice-input-wrap {
  position: relative;
  display: block;
}
.voice-input-wrap > input,
.voice-input-wrap > textarea {
  padding-right: 42px;
}
.voice-input-btn {
  position: absolute;
  z-index: 2;
  top: 50%;
  right: 6px;
  min-width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #64748b;
  font-size: 13px;
  line-height: 30px;
  transform: translateY(-50%);
  cursor: pointer;
}
.voice-input-label {
  margin-left: 2px;
  white-space: nowrap;
}
.voice-input-btn:hover {
  background: #e2e8f0;
  color: #0f766e;
}
.voice-input-btn.voice-input-active {
  background: #fee2e2;
  color: #dc2626;
  animation: voice-input-pulse 1.2s ease-in-out infinite;
}
.voice-input-host {
  position: relative;
}
.voice-input-host > .voice-input-btn {
  top: 18px;
  transform: none;
}
@keyframes voice-input-pulse {
  50% { opacity: .45; }
}
/* ===== 全局 ===== */
:root {
  --accent: #4f46e5;
  --accent-soft: #eef2ff;
  --sidebar-w: 264px;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #f1f5f9;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 15px; }

.app-shell { display: flex; min-height: 100vh; }

/* ===== 侧边栏 ===== */
.sidebar {
  width: var(--sidebar-w); flex: 0 0 var(--sidebar-w);
  background: linear-gradient(180deg, #0f172a 0%, #1e1b4b 100%);
  color: #cbd5e1; display: flex; flex-direction: column;
  padding: 20px 16px; position: sticky; top: 0; height: 100vh;
  overflow-y: auto;
}
.brand { display: flex; gap: 10px; align-items: center; padding: 2px 6px 16px; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand-mark {
  width: 38px; height: 38px; border-radius: 10px; flex: 0 0 38px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 20px; box-shadow: 0 6px 16px rgba(99,102,241,.4);
}
.brand-name { font-weight: 700; color: #fff; font-size: 15px; }
.brand-sub { font-size: 11px; color: #94a3b8; }

.menu { display: flex; flex-direction: column; gap: 4px; }
.menu-item {
  display: flex; align-items: center; gap: 10px; color: #cbd5e1;
  text-decoration: none; padding: 9px 12px; border-radius: 9px; font-size: 14.5px;
  transition: .15s;
}
.menu-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.menu-item.active { background: var(--accent); color: #fff; box-shadow: 0 4px 14px rgba(79,70,229,.45); }
.mi-ic { font-size: 11px; opacity: .85; width: 16px; text-align: center; }
.sidebar-section .sec-title { font-size: 11px; color: #64748b; text-transform: uppercase; letter-spacing: .08em; margin: 0 6px 8px; }
.btn-accent { background: var(--accent); border: none; color: #fff; font-weight: 600; border-radius: 9px; }
.btn-accent:hover { background: #4338ca; color: #fff; }

.cat-list { display: flex; flex-direction: column; }
.cat-item {
  display: flex; justify-content: space-between; color: #94a3b8; text-decoration: none;
  padding: 5px 6px; border-radius: 7px; font-size: 13.5px;
}
.cat-item:hover { background: rgba(255,255,255,.06); color: #e2e8f0; }
.cat-item .cnt { font-size: 11px; color: #64748b; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; }
.cloud-tag {
  color: #94a3b8; font-size: 12px; background: rgba(255,255,255,.06);
  padding: 3px 9px; border-radius: 20px; text-decoration: none;
}
.cloud-tag:hover { background: var(--accent); color: #fff; }

.sidebar-footer { margin-top: 18px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.08); }
.sync-card { background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08); border-radius: 12px; padding: 12px; }
.sync-line { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; color: #e2e8f0; }
.sync-line .dot { width: 8px; height: 8px; border-radius: 50%; background: #94a3b8; display: inline-block; }
.sync-line .dot.ok { background: #22c55e; box-shadow: 0 0 8px #22c55e; }
.sync-line .dot.err { background: #ef4444; box-shadow: 0 0 8px #ef4444; }
.sync-line .dot.busy { background: #eab308; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .3; } }
.sync-msg { font-size: 12px; color: #94a3b8; margin-top: 6px; word-break: break-all; }
.sync-time { font-size: 11px; color: #64748b; margin-top: 2px; }
.btn-sync { background: rgba(99,102,241,.25); border: 1px solid rgba(129,140,248,.4); color: #c7d2fe; font-size: 12px; }
.btn-sync:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ===== 主内容 ===== */
.main { flex: 1; min-width: 0; padding: 26px 30px 60px; }
.page-head { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.page-title { font-size: 22px; font-weight: 800; margin: 0; }
.page-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }

.card { border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 1px 3px rgba(15,23,42,.05); background: #fff; }
.card-title { font-weight: 700; }

/* 统计卡 */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat-card {
  background: #fff; border-radius: 14px; border: 1px solid var(--line);
  padding: 18px; display: flex; align-items: center; gap: 14px; text-decoration: none; color: inherit;
  box-shadow: 0 1px 3px rgba(15,23,42,.05); transition: .18s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(15,23,42,.1); }
.stat-ic {
  width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center;
  justify-content: center; font-size: 18px; font-weight: 800; flex: 0 0 46px;
}
.stat-num { font-size: 24px; font-weight: 800; line-height: 1.1; }
.stat-label { font-size: 12.5px; color: var(--muted); }

/* 列表/卡片 */
.note-row {
  display: flex; align-items: center; gap: 12px; padding: 13px 16px;
  border-bottom: 1px solid #f1f5f9; text-decoration: none; color: inherit;
  overflow: hidden; min-width: 0;
}
.note-row:last-child { border-bottom: none; }
.note-row:hover { background: #f8fafc; }
.note-row .t { font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-row .meta { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-row .flex-grow-1 { min-width: 0; }
.note-row .tbl-actions { flex: 0 0 auto; }
.badge-cat { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.chip { display: inline-block; background: #f1f5f9; color: #475569; font-size: 12px; padding: 2px 9px; border-radius: 20px; }

/* 笔记内容渲染 */
.note-content {
  line-height: 1.85; font-size: 15.5px;
  /* 防超宽：长 URL / 连续无空格字符 / 表格内容一律在容器内断行，避免撑破页面布局 */
  overflow-wrap: anywhere; word-break: break-word; min-width: 0;
}
.note-content h1, .note-content h2, .note-content h3 { margin-top: 1.2em; margin-bottom: .5em; font-weight: 700; }
.note-content h1 { font-size: 1.5rem; } .note-content h2 { font-size: 1.3rem; } .note-content h3 { font-size: 1.12rem; }
.note-content p { margin: .7em 0; }
.note-content img, .note-content video, .note-content iframe { max-width: 100%; border-radius: 8px; }
.note-content pre {
  background: #0f172a; color: #e2e8f0; padding: 14px; border-radius: 10px;
  overflow-x: auto; font-size: 13.5px; max-width: 100%;
}
.note-content code { background: #eef2ff; color: #4338ca; padding: 2px 6px; border-radius: 5px; font-size: .9em; }
.note-content pre code { background: none; color: inherit; padding: 0; }
.note-content blockquote { border-left: 4px solid #c7d2fe; background: #f8fafc; margin: .8em 0; padding: 8px 14px; border-radius: 0 8px 8px 0; color: #475569; overflow-wrap: break-word; }
.note-content table { border-collapse: collapse; width: 100%; max-width: 100%; margin: .8em 0; table-layout: fixed; }
.note-content th, .note-content td { border: 1px solid var(--line); padding: 7px 11px; overflow-wrap: anywhere; word-break: break-word; }
.note-content th { background: #f8fafc; }
.note-content a { color: var(--accent); overflow-wrap: anywhere; }
.note-task-action { position: fixed; z-index: 1055; border: 1px solid #c7d2fe; border-radius: 7px; background: #fff; color: var(--accent); box-shadow: 0 4px 14px rgba(15,23,42,.16); padding: 5px 10px; font-size: 12px; cursor: pointer; }
.note-task-action:hover { background: var(--accent-soft); }

/* 上传页 */
.drop-zone {
  border: 2px dashed #c7d2fe; border-radius: 16px; background: #fafaff;
  padding: 46px 20px; text-align: center; cursor: pointer; transition: .2s;
}
.drop-zone:hover, .drop-zone.over { border-color: var(--accent); background: var(--accent-soft); }
.upload-preview-list .up-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; margin-top: 8px; background: #fff; }

/* 书架 */
.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.book-card {
  background: #fff; border-radius: 14px; overflow: hidden; color: inherit;
  border: 1px solid var(--line); box-shadow: 0 1px 3px rgba(15,23,42,.06); transition: .18s; display: flex; flex-direction: column;
}
.book-card:hover { transform: translateY(-3px); box-shadow: 0 10px 26px rgba(15,23,42,.12); }
.book-link { color: inherit; text-decoration: none; display: flex; flex-direction: column; flex: 1; }
.book-delete { border: 0; border-top: 1px solid var(--line); background: #fff; color: #dc2626; padding: 7px 12px; font-size: 12px; text-align: right; cursor: pointer; }
.book-delete:hover { background: #fef2f2; }
.book-cover {
  height: 150px; display: flex; align-items: center; justify-content: center; overflow: hidden;
  background: linear-gradient(135deg, #eef2ff, #ede9fe);
  font-size: 40px; font-weight: 800; color: var(--accent); position: relative; isolation: isolate;
}
.book-cover canvas, .book-cover .epub-render { max-width: 100%; max-height: 100%; position: absolute; inset: 0; margin: auto; }
.book-cover canvas { width: 100%; height: 100%; object-fit: contain; z-index: 1; }
.book-cover .cover-image { width: 100%; height: 100%; object-fit: contain; position: absolute; inset: 0; z-index: 1; }
.book-cover .epub-render { width: 100%; height: 100%; z-index: 1; }
.book-cover .epub-render iframe { border: 0; width: 100%; height: 100%; pointer-events: none; }
.book-cover.has-cover .cover-fallback { display: none; }
.book-cover .fmt { position: absolute; top: 10px; right: 10px; font-size: 10px; background: rgba(15,23,42,.55); color: #fff; padding: 2px 8px; border-radius: 10px; }
.book-body { padding: 12px 14px; flex: 1; display: flex; flex-direction: column; }
.book-name { font-weight: 600; font-size: 14px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.book-meta { font-size: 12px; color: var(--muted); margin-top: auto; padding-top: 6px; }
.book-meta .opened { color: var(--accent); margin-right: 8px; }

/* 表格通用 */
.tbl-actions .btn { padding: 2px 9px; font-size: 12.5px; }
.ext-chip {
  font-size: 10.5px; font-weight: 700; padding: 3px 8px; border-radius: 7px; color: #fff; letter-spacing: .03em;
}
.ext-pdf { background: #dc2626; } .ext-epub { background: #7c3aed; }
.ext-docx, .ext-doc { background: #2563eb; } .ext-xlsx, .ext-xls, .ext-csv { background: #16a34a; }
.ext-image { background: #db2777; } .ext-txt, .ext-md { background: #64748b; } .ext-other { background: #94a3b8; }

/* 工具栏 */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.search-box { position: relative; flex: 1; min-width: 220px; max-width: 420px; }
.search-box input { width: 100%; padding: 8px 14px 8px 36px; border: 1px solid var(--line); border-radius: 10px; font-size: 14px; outline: none; }
.search-box input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-box .sg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #94a3b8; }

/* 资料库：左侧文件夹栏 + 右侧文件列表 */
.files-layout { display: flex; gap: 16px; align-items: flex-start; }
.folder-panel { width: 236px; flex: 0 0 236px; padding: 12px 10px; }
.fp-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11.5px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .08em; margin: 2px 4px 10px;
}
.fp-add { border: 0; background: none; color: var(--accent); font-size: 12.5px; font-weight: 600; padding: 2px 6px; border-radius: 6px; }
.fp-add:hover { background: var(--accent-soft); }
.folder-list { display: flex; flex-direction: column; gap: 2px; }
.folder-row { display: flex; align-items: center; border-radius: 9px; }
.folder-row:hover { background: #f1f5f9; }
.folder-row .folder-item { flex: 1; min-width: 0; }
.folder-ops { display: none; gap: 2px; padding-right: 6px; flex: 0 0 auto; }
.folder-row:hover .folder-ops { display: flex; }
.folder-ops button { border: 0; background: none; color: #94a3b8; font-size: 12px; padding: 2px 4px; border-radius: 5px; }
.folder-ops button:hover { background: #e2e8f0; color: #334155; }
.folder-item {
  display: flex; align-items: center; gap: 8px; padding: 7px 9px;
  border-radius: 9px; color: #475569; text-decoration: none; font-size: 13.5px;
}
.folder-item:hover { background: #f1f5f9; color: #0f172a; }
.folder-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.folder-item .fi-ic { font-size: 12.5px; flex: 0 0 auto; }
.folder-item .fname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-item .cnt { font-size: 11px; color: var(--muted); flex: 0 0 auto; }
.fp-tip { font-size: 12px; color: var(--muted); line-height: 1.6; padding: 9px 6px 2px; border-top: 1px dashed var(--line); margin-top: 10px; }
.files-main { flex: 1; min-width: 0; }
.crumb { font-size: 12.5px; color: var(--muted); margin-bottom: 10px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.crumb a { color: var(--accent); text-decoration: none; }
.crumb .cur { color: #334155; font-weight: 600; }
.sel-bar {
  display: none; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--accent-soft); border: 1px solid #c7d2fe; border-radius: 11px;
  padding: 8px 12px; margin-bottom: 12px; font-size: 13px; color: #3730a3;
}
@media (hover: none) { .folder-ops { display: flex; } }
@media (max-width: 900px) {
  .files-layout { flex-direction: column; }
  .folder-panel { width: 100%; flex: none; }
}

/* 阅读器区域（iframe 式全高） */
.reader-shell { display: flex; flex-direction: column; height: calc(100vh - 140px); min-height: 480px; }
.reader-toolbar { display: flex; align-items: center; gap: 6px; padding: 8px 12px; background: #0f172a; color: #cbd5e1; border-radius: 14px 14px 0 0; flex-wrap: wrap; }
.reader-toolbar .btn-sm { color: #cbd5e1; border-color: #334155; }
.reader-body { flex: 1; background: #f8fafc; overflow: auto; position: relative; border: 1px solid var(--line); border-radius: 0 0 14px 14px; }
#pdfCanvasBox canvas { display: block; margin: 0 auto; box-shadow: 0 4px 18px rgba(0,0,0,.18); background: #fff; }
/* PDF 上下滚动阅读：整份文档连续竖排，滚到附近的页才真正渲染（未渲染的先显示页码占位） */
.pdf-slot { position: relative; background: #fff; border-radius: 3px; box-shadow: 0 4px 18px rgba(0,0,0,.18); margin: 0 auto; }
.pdf-slot:not(.done)::before { content: attr(data-p); position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #cbd5e1; font-size: 13px; letter-spacing: 1px; }
#pdfCanvasBox .pdf-slot canvas { margin: 0; box-shadow: none; border-radius: 0; }
.epub-viewer-frame { position: relative; inset: auto; width: 100%; min-height: 100%; }
#epubViewer { width: 100%; height: 100%; min-height: 100%; overflow: hidden; background: #fff; }
#epubViewer iframe { width: 100% !important; height: 100% !important; min-height: 100% !important; border: 0; display: block; }
#epubViewer.scroll-mode { overflow: visible; }
#epubViewer.scroll-mode .epub-scroll-section { width: min(100%, 900px); margin: 0 auto; padding: 32px 40px 8px; background: #fff; box-sizing: border-box; }
#epubViewer.scroll-mode .epub-scroll-section > :not(style) { display: block; }
#epubViewer.scroll-mode img, #epubViewer.scroll-mode svg, #epubViewer.scroll-mode video, #epubViewer.scroll-mode canvas, #epubViewer.scroll-mode table { max-width: 100%; }
#epubViewer.scroll-mode p, #epubViewer.scroll-mode li, #epubViewer.scroll-mode div, #epubViewer.scroll-mode td, #epubViewer.scroll-mode th { line-height: 1.75; }

.text-viewer { padding: 40px 8%; font-family: Consolas, 'Courier New', monospace; font-size: 14px; white-space: pre-wrap; word-break: break-word; background: #fff; min-height: 100%; }
.img-viewer { padding: 30px; text-align: center; }
.sheet-viewer { padding: 20px; }
.sheet-viewer table { border-collapse: collapse; font-size: 13px; background: #fff; }
.sheet-viewer td, .sheet-viewer th { border: 1px solid var(--line); padding: 6px 10px; }
.sheet-viewer th { background: #f8fafc; position: sticky; top: 0; }

/* 其他 */
.empty-state { text-align: center; padding: 60px 20px; color: #94a3b8; }
.empty-state .big { font-size: 42px; opacity: .6; }

@media print {
  @page {
    size: A4 portrait;
    margin: 12mm 12mm 10mm;
  }

  html, body {
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    color: #111827 !important;
    font-size: 12pt !important;
    line-height: 1.7 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .print-hide, .sidebar, .page-head, .note-task-action, .reader-toolbar, .sheet-toolbar, .col-lg-4 {
    display: none !important;
  }

  body.pdf-print-mode #pdfCanvasBox,
  body.pdf-print-mode .reader-shell,
  body.pdf-print-mode .reader-body,
  body.pdf-print-mode .reader-toolbar,
  body.pdf-print-mode .page-head {
    display: none !important;
  }

  .main {
    padding: 0 !important;
    max-width: none !important;
    width: 100% !important;
  }

  .row, .col-lg-8, .card, .card-body, .print-note-card, .reader-shell, .reader-body {
    display: block !important;
    width: auto !important;
    max-width: none !important;
    float: none !important;
  }

  .print-note-card { border: 0 !important; box-shadow: none !important; }
  .print-note-card .card-body { padding: 0 !important; }
  .reader-shell { height: auto !important; min-height: 0 !important; overflow: visible !important; }
  .reader-body { overflow: visible !important; border: 0 !important; border-radius: 0 !important; background: #fff !important; padding: 0 !important; }

  .pdf-print-pages {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
  }
  .pdf-print-page {
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    width: 100% !important;
    overflow: hidden !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    page-break-after: always !important;
    break-after: page !important;
  }
  .pdf-print-page:last-child {
    page-break-after: auto !important;
    break-after: auto !important;
  }
  .pdf-print-title {
    flex: 0 0 auto !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 0 0 5mm !important;
    color: #111827 !important;
    font-size: 16pt !important;
    line-height: 1.25 !important;
    font-weight: 600 !important;
    text-align: center !important;
    overflow: hidden !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
  }
  .pdf-print-number {
    flex: 0 0 auto !important;
    width: 100% !important;
    padding-top: 3mm !important;
    color: #64748b !important;
    font-size: 9pt !important;
    line-height: 1 !important;
    text-align: center !important;
  }
  .pdf-print-pages canvas {
    display: block !important;
    max-width: 100% !important;
    height: auto !important;
    margin: 0 auto 0 !important;
    box-shadow: none !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    page-break-after: auto !important;
    break-after: auto !important;
  }
  .pdf-print-pages canvas:first-child {
    margin-top: 0 !important;
  }
  .pdf-print-pages canvas:last-child {
    margin-bottom: 0 !important;
  }

  .note-content, .text-viewer, .sheet-viewer, .docx-wrap {
    font-size: 12pt !important;
    line-height: 1.7 !important;
  }
  .note-content h1 { font-size: 18pt !important; }
  .note-content h2 { font-size: 16pt !important; }
  .note-content h3 { font-size: 14pt !important; }
  .note-content p, .note-content li, .note-content td, .note-content th, .note-content blockquote {
    font-size: 12pt !important;
  }

  #pdfCanvasBox canvas {
    box-shadow: none;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    page-break-after: auto !important;
    break-after: auto !important;
  }
  .pdf-print-pages { display: block !important; }
  .pdf-print-pages canvas {
    display: block;
    height: auto;
    margin: 0 auto 0 !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    page-break-after: auto !important;
    break-after: auto !important;
  }
  .pdf-print-pages canvas:last-child { page-break-after: auto; break-after: auto; margin-bottom: 0 !important; }
  .print-title { display: none !important; }
}
.pdf-print-pages { display: none; }
.print-title { display: none; }
/* 富文本编辑器（Quill） */
.note-editor .ql-toolbar {
  border: 1px solid var(--line); border-bottom: 0;
  border-radius: 12px 12px 0 0; background: #fff;
}
.note-editor .ql-toolbar .ql-stroke { stroke: #475569; }
.note-editor .ql-toolbar .ql-fill { fill: #475569; }
.note-editor .ql-toolbar button.ql-pdf { width: 42px; }
.note-editor .ql-toolbar button.ql-pdf::after {
  content: 'PDF';
  color: #dc2626;
  font-size: 11px;
  font-weight: 700;
}
.note-editor .ql-toolbar button.ql-word,
.note-editor .ql-toolbar button.ql-excel { width: 42px; }
.note-editor .ql-toolbar button.ql-word::after,
.note-editor .ql-toolbar button.ql-excel::after {
  color: #2563eb;
  font-size: 10px;
  font-weight: 700;
}
.note-editor .ql-toolbar button.ql-word::after { content: 'Word'; }
.note-editor .ql-toolbar button.ql-excel::after { content: 'Excel'; }
.note-editor .ql-container { border: 1px solid var(--line); border-radius: 0 0 12px 12px; }
.note-editor .ql-editor { min-height: 56vh; font-size: 15.5px; line-height: 1.85; padding: 14px 16px; }
.note-editor .ql-editor.ql-blank::before { color: #94a3b8; font-style: normal; left: 16px; }
.note-editor .ql-editor img { max-width: 100%; border-radius: 8px; }
.note-editor .ql-editor a.pdf-card,
.note-content a.pdf-card {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  margin: 8px 0;
  padding: 10px 14px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fff7f7;
  color: #991b1b;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
}
.note-editor .ql-editor a.pdf-card::before,
.note-content a.pdf-card::before {
  content: 'PDF';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 6px;
  background: #dc2626;
  color: #fff;
  font-size: 11px;
}
.note-editor .ql-editor a.pdf-card:hover,
.note-content a.pdf-card:hover { border-color: #ef4444; background: #fee2e2; }
.note-editor .ql-editor a.office-card,
.note-content a.office-card {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  margin: 8px 0;
  padding: 10px 14px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
}
.note-editor .ql-editor a.office-card::before,
.note-content a.office-card::before {
  content: 'DOC';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 38px;
  height: 34px;
  border-radius: 6px;
  background: #2563eb;
  color: #fff;
  font-size: 10px;
}
.note-editor .ql-editor a.office-card[data-office-kind="excel"]::before,
.note-content a.office-card[data-office-kind="excel"]::before {
  content: 'XLS';
  background: #16a34a;
}
.note-editor .ql-editor a.office-card:hover,
.note-content a.office-card:hover { border-color: #60a5fa; background: #dbeafe; }
a { text-decoration: none; }
