/* ============ 文档中心 ============ */
.doc-page .doc-side { width: 280px; display: flex; flex-direction: column; position: sticky; top: 0; align-self: flex-start; height: calc(100vh - 88px); }
.doc-space-opt { display: inline-flex; align-items: center; gap: 6px; }
.doc-space-info { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; min-width: 0; }
.doc-tree-head { margin: 2px 0 6px; }
.doc-tree { background: transparent; flex: 1; overflow: auto; }
.doc-tree .el-tree-node__content { height: 32px; border-radius: 6px; }
.doc-tree .tree-node { min-width: 0; }
.doc-tree-title { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.doc-tree-icon { color: #8a94a6; flex-shrink: 0; }
.doc-tree .el-tree-node.is-current > .el-tree-node__content { background: var(--el-color-primary-light-9); color: var(--el-color-primary); font-weight: 500; }
.doc-tree .tree-ops .el-button + .el-button { margin-left: 2px; }

.doc-search { flex: 1; overflow: auto; }
.doc-search-item { padding: 8px 8px; border-radius: 6px; cursor: pointer; border-bottom: 1px dashed var(--to-border); }
.doc-search-item:hover { background: var(--el-fill-color-light); }
.doc-search-title { font-weight: 500; margin-bottom: 2px; }
.doc-search-snippet { font-size: 12.5px; color: var(--el-text-color-regular); line-height: 1.5; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; word-break: break-all; }
.doc-search-meta { font-size: 12px; color: var(--to-muted); margin-top: 2px; }
.doc-search mark { background: #ffe58f; color: inherit; padding: 0 1px; border-radius: 2px; }
html.dark .doc-search mark { background: #806a00; }

.doc-home-head { display: flex; align-items: center; gap: 14px; padding-bottom: 16px; border-bottom: 1px solid var(--to-border); }
.doc-home-head h2 { margin: 0 0 4px; font-size: 20px; }
.doc-home-icon { width: 54px; height: 54px; border-radius: 12px; background: linear-gradient(135deg, #2f6bff, #6b9bff); color: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.doc-section-title { font-weight: 600; margin: 18px 0 8px; font-size: 14px; }
.doc-recent { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px; }
.doc-recent-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--to-border); border-radius: 8px; cursor: pointer; transition: border-color .2s, box-shadow .2s; min-width: 0; margin-bottom: 8px; }
.doc-recent .doc-recent-item { margin-bottom: 0; }
.doc-recent-item:hover { border-color: var(--el-color-primary-light-5); box-shadow: 0 4px 12px rgba(31, 56, 108, .08); }
.doc-recent-icon { font-size: 20px; color: var(--el-color-primary); flex-shrink: 0; }
.doc-recent-title { font-weight: 500; }

/* 阅读 */
.doc-page .doc-reader { overflow: visible; }
.doc-reader > .el-card__body { padding: 0; }
.doc-reader-bar { display: flex; align-items: center; gap: 6px; padding: 10px 16px; border-bottom: 1px solid var(--to-border); flex-wrap: wrap; position: sticky; top: 0; background: var(--to-card); z-index: 5; border-radius: 8px 8px 0 0; }
.doc-reader-bar .el-button + .el-button { margin-left: 0; }
.doc-reader-bar .el-breadcrumb a { cursor: pointer; font-weight: normal; color: var(--to-muted); }
.doc-reader-bar .el-breadcrumb a:hover { color: var(--el-color-primary); }
.doc-reader-wrap { display: flex; gap: 24px; padding: 20px 32px 32px; }
.doc-reader-main { flex: 1; min-width: 0; max-width: 960px; }
.doc-title { font-size: 28px; margin: 4px 0 8px; line-height: 1.35; word-break: break-word; }
.doc-meta { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; color: var(--to-muted); font-size: 13px; padding-bottom: 14px; margin-bottom: 8px; border-bottom: 1px solid var(--to-border); }
.doc-meta span { display: inline-flex; align-items: center; gap: 4px; }
.doc-children { margin-top: 24px; border-top: 1px dashed var(--to-border); }
.doc-outline { width: 200px; flex-shrink: 0; position: sticky; top: 64px; align-self: flex-start; max-height: calc(100vh - 160px); overflow: auto; border-left: 2px solid var(--to-border); padding-left: 10px; }
.doc-outline-title { font-weight: 600; font-size: 13px; color: var(--to-muted); margin-bottom: 6px; }
.doc-outline-item { font-size: 13px; line-height: 1.9; cursor: pointer; color: var(--el-text-color-regular); }
.doc-outline-item:hover { color: var(--el-color-primary); }

/* 编辑 */
.doc-editor-card > .el-card__body { padding: 12px 16px 16px; }
.doc-editor-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.doc-editor-bar .el-button + .el-button { margin-left: 0; }
.doc-title-input { flex: 1; min-width: 220px; }
.doc-title-input .el-input__inner { font-size: 18px; font-weight: 600; }
.doc-save-state { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--to-muted); white-space: nowrap; }
.doc-save-state.s-saved { color: #67c23a; }
.doc-save-state.s-unsaved, .doc-save-state.s-saving { color: #e6a23c; }
.doc-save-state.s-conflict, .doc-save-state.s-error { color: #f56c6c; }
.doc-help { cursor: help; font-size: 16px; }

/* 模板 */
.doc-tpl-scroll { max-height: 420px; overflow: auto; padding-right: 4px; }
.doc-tpl-cat { font-weight: 600; font-size: 13px; color: var(--to-muted); margin: 10px 0 8px; }
.doc-tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.doc-tpl-card { border: 1px solid var(--to-border); border-radius: 8px; padding: 10px 12px; cursor: pointer; transition: all .15s; min-width: 0; }
.doc-tpl-card:hover { border-color: var(--el-color-primary-light-5); }
.doc-tpl-card.active { border-color: var(--el-color-primary); background: var(--el-color-primary-light-9); box-shadow: 0 0 0 1px var(--el-color-primary) inset; }
.doc-tpl-name { display: flex; align-items: center; gap: 6px; font-weight: 500; margin-bottom: 4px; min-width: 0; }
.doc-tpl-desc { font-size: 12px; color: var(--to-muted); line-height: 1.5; height: 36px; overflow: hidden; }

/* 历史版本 */
.doc-ver { display: flex; gap: 16px; height: 100%; }
.doc-ver-list { width: 240px; flex-shrink: 0; overflow: auto; border-right: 1px solid var(--to-border); padding-right: 12px; }
.doc-ver-item { padding: 8px 10px; border-radius: 6px; cursor: pointer; margin-bottom: 4px; border: 1px solid transparent; }
.doc-ver-item:hover { background: var(--el-fill-color-light); }
.doc-ver-item.active { background: var(--el-color-primary-light-9); border-color: var(--el-color-primary-light-7); }
.doc-ver-view { flex: 1; min-width: 0; overflow: auto; }
.doc-ver-title { font-size: 16px; }

/* 评论 */
.doc-cmt { display: flex; flex-direction: column; height: 100%; }
.doc-cmt-list { flex: 1; overflow: auto; }
.doc-cmt-item { padding: 10px 12px; border: 1px solid var(--to-border); border-radius: 8px; margin-bottom: 10px; }
.doc-cmt-item.resolved { opacity: .65; }
.doc-cmt-quote { margin: 8px 0 4px; padding: 4px 10px; border-left: 3px solid #c9d4ea; background: var(--el-fill-color-lighter); color: var(--to-muted); font-size: 12.5px; white-space: pre-wrap; max-height: 80px; overflow: auto; }
.doc-cmt-content { margin-top: 6px; white-space: pre-wrap; word-break: break-word; line-height: 1.6; }
.doc-cmt-ops { text-align: right; margin-top: 2px; }
.doc-cmt-form { border-top: 1px solid var(--to-border); padding-top: 12px; margin-top: 8px; }

/* API 文档 */
.apidoc-page .apidoc-toc { position: sticky; top: 0; align-self: flex-start; height: calc(100vh - 88px); }
.apidoc-toc .doc-outline-item.lv1 { font-weight: 600; }
.apidoc-toc .doc-outline-item.lv2 { font-weight: 500; }
.apidoc-body { min-height: 300px; }

@media (max-width: 1100px) {
  .doc-outline { display: none; }
  .doc-reader-wrap { padding: 16px; }
}
@media (max-width: 800px) {
  .doc-page.split-page, .apidoc-page.split-page { flex-direction: column; }
  .doc-page .doc-side, .apidoc-page .apidoc-toc { width: 100%; position: static; height: auto; max-height: 360px; }
}

/* 空间归属项目 */
.doc-space-scope { margin-left: 6px; }
.doc-space-info .el-tag { flex-shrink: 0; }

/* ---------- 表格文档 ---------- */
.doc-tree-icon.is-sheet, .doc-recent-icon.is-sheet, .doc-sheet-mini { color: #1f9d55; }
.doc-sheet-mini { margin-right: 4px; vertical-align: -2px; }
.doc-sheet-card .doc-sheet-body { padding: 12px 16px 16px; }
.doc-sheet-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.doc-sheet-icon { font-size: 24px; color: #1f9d55; flex-shrink: 0; }
.doc-sheet-title .el-input__wrapper { box-shadow: none; padding-left: 4px; }
.doc-sheet-title .el-input__wrapper:hover, .doc-sheet-title .el-input__wrapper.is-focus { box-shadow: 0 0 0 1px var(--el-input-hover-border-color) inset; }
.doc-sheet-title-ro { font-size: 22px; margin: 0; flex: 1; min-width: 200px; }

.sheet-grid { display: flex; flex-direction: column; min-width: 0; }
.sheet-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.sheet-toolbar .el-button + .el-button { margin-left: 0; }
.sheet-search { width: 200px; }
.sheet-sort { width: 170px; }
.sheet-scroll { overflow: auto; border: 1px solid var(--to-border); border-radius: 6px; background: var(--to-card); position: relative; min-height: 120px; }
.sheet-table { table-layout: fixed; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.sheet-table th, .sheet-table td { border-right: 1px solid var(--to-border); border-bottom: 1px solid var(--to-border); height: 34px; padding: 0 8px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; box-sizing: border-box; background: var(--to-card); }
.sheet-table thead th { position: sticky; top: 0; z-index: 3; background: var(--el-fill-color-light); font-weight: 500; color: var(--el-text-color-regular); text-align: left; }
.sheet-table .sheet-rn { position: sticky; left: 0; z-index: 2; background: var(--el-fill-color-lighter); text-align: center; color: var(--to-muted); padding: 0 2px; font-size: 12px; }
.sheet-table thead .sheet-rn { z-index: 4; background: var(--el-fill-color-light); }
.sheet-tr:hover td { background: var(--el-fill-color-lighter); }
.sheet-tr:hover td.sheet-rn { background: var(--el-fill-color); }
.sheet-grid:not(.is-readonly) .sheet-td { cursor: pointer; }
.sheet-td.is-active { padding: 0 2px; box-shadow: inset 0 0 0 2px var(--el-color-primary); overflow: visible; }
.sheet-td.ct-NUMBER { text-align: right; }
.sheet-td.ct-CHECKBOX { text-align: center; }
.sheet-td-pad { background: transparent; }
.sheet-rn-ops { display: flex; justify-content: center; gap: 1px; }
.sheet-rn-ops span { cursor: pointer; padding: 2px; border-radius: 3px; display: inline-flex; color: var(--to-muted); font-size: 13px; }
.sheet-rn-ops span:hover { color: var(--el-color-primary); background: var(--el-fill-color-dark); }
.sheet-rn-ops span.danger:hover { color: #f56c6c; }

.sheet-th-inner { display: flex; align-items: center; gap: 4px; min-width: 0; }
.sheet-th-icon { color: var(--to-muted); flex-shrink: 0; }
.sheet-th-name { flex: 1; min-width: 0; }
.sheet-sort-ind { color: var(--el-color-primary); flex-shrink: 0; }
.sheet-th-more { cursor: pointer; color: var(--to-muted); display: inline-flex; padding: 3px; border-radius: 4px; outline: none; }
.sheet-th-more:hover { background: var(--el-fill-color-dark); color: var(--el-color-primary); }
.sheet-resizer { position: absolute; right: 0; top: 0; bottom: 0; width: 5px; cursor: col-resize; z-index: 5; }
.sheet-resizer:hover { background: var(--el-color-primary-light-5); }
.sheet-th-add { text-align: center !important; cursor: pointer; color: var(--to-muted) !important; }
.sheet-th-add:hover { color: var(--el-color-primary) !important; }
.sheet-empty { text-align: center; color: var(--to-muted); height: 80px !important; }
.sheet-add-row td { color: var(--to-muted); cursor: pointer; padding-left: 16px; }
.sheet-add-row td:hover { color: var(--el-color-primary); background: var(--el-fill-color-lighter); }

.sheet-cell-flex { display: flex; align-items: center; gap: 6px; min-width: 0; }
.sheet-link-text { color: var(--el-color-primary); }
.sheet-link-open { color: var(--el-color-primary); display: inline-flex; flex-shrink: 0; }
.sheet-avatar { width: 20px; height: 20px; border-radius: 50%; background: var(--el-color-primary-light-7); color: var(--el-color-primary); display: inline-flex; align-items: center; justify-content: center; font-size: 11px; flex-shrink: 0; }
.sheet-check { height: auto; margin-right: 0; vertical-align: middle; }
.sheet-check .el-checkbox__input { cursor: inherit; }
.sheet-editor { width: 100%; }
.sheet-editor .el-input-number, .sheet-editor .el-select, .sheet-editor .el-date-editor.el-input { width: 100%; }
.sheet-num-input .el-input__inner { text-align: right; }
.sheet-col-opt { display: inline-flex; align-items: center; gap: 6px; }
.sheet-col-opt .muted { font-size: 12px; margin-left: 4px; }
.sheet-opt-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.sheet-opt-row .sheet-tag { width: 90px; flex-shrink: 0; text-align: center; }

/* 单选标签颜色 */
.sheet-tag { display: inline-block; padding: 0 8px; line-height: 20px; border-radius: 10px; font-size: 12px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
.sheet-tag.t0 { background: #e8f0ff; color: #2f6bff; }
.sheet-tag.t1 { background: #e3f6eb; color: #1f9d55; }
.sheet-tag.t2 { background: #fff3dc; color: #c27c00; }
.sheet-tag.t3 { background: #fdeaea; color: #e5484d; }
.sheet-tag.t4 { background: #f0eaff; color: #7c4dff; }
.sheet-tag.t5 { background: #e2f6f8; color: #0f8fa3; }
.sheet-tag.t6 { background: #fdebf5; color: #c92a7a; }
.sheet-tag.t7 { background: #eef1f5; color: #4a5a78; }
.sheet-tag.tx { background: var(--el-fill-color); color: var(--to-muted); }
html.dark .sheet-tag.t0 { background: rgba(47, 107, 255, .22); color: #8fb0ff; }
html.dark .sheet-tag.t1 { background: rgba(31, 157, 85, .22); color: #74d39b; }
html.dark .sheet-tag.t2 { background: rgba(230, 162, 60, .22); color: #f0c274; }
html.dark .sheet-tag.t3 { background: rgba(229, 72, 77, .22); color: #f59a9d; }
html.dark .sheet-tag.t4 { background: rgba(124, 77, 255, .24); color: #b8a0ff; }
html.dark .sheet-tag.t5 { background: rgba(15, 143, 163, .24); color: #6fd2e0; }
html.dark .sheet-tag.t6 { background: rgba(201, 42, 122, .24); color: #f08cbf; }
html.dark .sheet-tag.t7 { background: rgba(140, 150, 170, .2); color: #b5bfd0; }

/* 通知规则 */
.sheet-rule-tip { line-height: 1.5; margin-top: 4px; font-size: 12px; width: 100%; }
.sheet-cond { display: flex; align-items: center; gap: 8px; width: 100%; }
.sheet-cond-col { width: 180px; flex-shrink: 0; }
.sheet-cond-op { width: 130px; flex-shrink: 0; }
.sheet-ph-btns { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.sheet-ph-btns .el-button + .el-button { margin-left: 0; }

@media (max-width: 800px) {
  .sheet-search, .sheet-sort { width: 140px; }
  .sheet-cond { flex-wrap: wrap; }
}

/* ============ 告警中心 ============ */
.el-table .alert-row-firing td.el-table__cell:first-child { box-shadow: inset 3px 0 0 #f56c6c; }
.alert-cond { font-weight: 500; }
.alert-op { display: inline-block; min-width: 32px; text-align: center; font-size: 16px; font-weight: 600; color: var(--el-color-primary); }

.channel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.channel-card { border: 1px solid var(--to-border); border-radius: 10px; padding: 14px; background: var(--to-card); transition: box-shadow .2s; }
.channel-card:hover { box-shadow: 0 6px 18px rgba(31, 56, 108, .08); }
.channel-card.disabled { opacity: .6; }
.channel-head { display: flex; align-items: center; gap: 12px; }
.channel-icon { width: 40px; height: 40px; border-radius: 10px; color: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.channel-name { font-weight: 600; font-size: 15px; }
.channel-summary { margin: 12px 0 10px; font-size: 12.5px; color: var(--el-text-color-regular); background: var(--to-code-bg); border-radius: 6px; padding: 6px 10px; }
.channel-ops { display: flex; align-items: center; gap: 4px; }
.channel-ops .spacer { flex: 1; }
