/* ===== 云文档中心风格 帮助文档详情页 ===== */

:root {
  --tc-primary: #0058ff;
  --tc-ink: #1e2736;
  --tc-muted: #8692b0;
  --tc-line: #e6e7eb;
  --tc-bg: #f7f8fa;
}

.help-total {
  background: #fff;
}

.el-container .el-main {
  background: #fff;
}

/* 三栏布局（位于控制台侧边栏右侧） */
.tc-doc-page {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  min-height: calc(100vh - 50px);
  background: #fff;
}

/* ===== 左侧目录 ===== */
.tc-doc-side {
  position: sticky;
  top: 50px;
  width: 300px;
  flex-shrink: 0;
  height: calc(100vh - 50px);
  overflow-y: auto;
  padding: 20px 16px 32px;
  border-right: 1px solid var(--tc-line);
  background: #fff;
  box-sizing: border-box;
}

.tc-doc-side::-webkit-scrollbar {
  width: 6px;
}

.tc-doc-side::-webkit-scrollbar-thumb {
  background: #d8dce6;
  border-radius: 3px;
}

.tc-doc-side-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
  color: var(--tc-ink);
  padding: 0 4px 16px;
}

.tc-doc-side-head i {
  font-size: 18px;
  color: var(--tc-ink);
}

.tc-doc-side-search {
  padding: 0 4px 16px;
}

.tc-doc-side-search .el-input__inner {
  border-radius: 2px;
  font-size: 13px;
}

.tc-doc-side-search .el-input__prefix {
  display: flex;
  align-items: center;
  left: 8px;
  color: var(--tc-muted);
}

.tc-doc-side-search .el-input--small .el-input__inner {
  padding-left: 28px;
}

.tc-doc-tree-group {
  margin-bottom: 4px;
}

.tc-doc-tree-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--tc-ink);
  cursor: pointer;
  user-select: none;
}

.tc-doc-tree-title:hover {
  color: var(--tc-primary);
}

.tc-doc-tree-title i {
  font-size: 12px;
  color: var(--tc-muted);
}

.tc-doc-tree-item {
  display: block;
  position: relative;
  padding: 7px 8px 7px 16px;
  font-size: 13px;
  line-height: 20px;
  color: #4e5969;
  cursor: pointer;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  text-decoration: none;
  border-radius: 2px;
}

.tc-doc-tree-item:hover {
  color: var(--tc-primary);
  background: var(--tc-bg);
}

.tc-doc-tree-item.is-active {
  color: var(--tc-primary);
  background: #f2f7ff;
  font-weight: 500;
}

.tc-doc-tree-item.is-active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  background: var(--tc-primary);
  border-radius: 2px;
}

.tc-doc-tree-empty {
  padding: 24px 4px;
  font-size: 13px;
  color: var(--tc-muted);
  text-align: center;
}

/* ===== 中间文章 ===== */
.tc-doc-main {
  flex: 1;
  min-width: 0;
  padding: 24px 48px 48px;
  box-sizing: border-box;
}

.tc-doc-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 13px;
  color: var(--tc-muted);
  margin-bottom: 20px;
}

.tc-doc-breadcrumb i {
  font-size: 12px;
  color: #c0c6d4;
}

.tc-doc-crumb {
  max-width: 260px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.tc-doc-crumb-link {
  cursor: pointer;
}

.tc-doc-crumb-link:hover {
  color: var(--tc-primary);
}

.tc-doc-crumb-current {
  color: var(--tc-primary);
}

.tc-doc-title {
  margin: 0 0 12px;
  font-size: 30px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--tc-ink);
}

.tc-doc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  font-size: 13px;
  color: var(--tc-muted);
  padding-bottom: 20px;
  margin-bottom: 24px;
  border-bottom: 1px solid #f0f1f5;
}

/* 正文排版 */
.tc-doc-article {
  font-size: 14px;
  line-height: 1.9;
  color: #2c3648;
  word-wrap: break-word;
  word-break: normal;
}

.tc-doc-article img {
  max-width: 100%;
  height: auto;
  border: 1px solid #f0f1f5;
  border-radius: 4px;
  margin: 8px 0;
}

.tc-doc-article p {
  margin: 0 0 14px;
}

.tc-doc-article a {
  color: var(--tc-primary);
  text-decoration: none;
}

.tc-doc-article a:hover {
  text-decoration: underline;
}

.tc-doc-article h1,
.tc-doc-article h2 {
  margin: 32px 0 14px;
  font-size: 22px;
  font-weight: 600;
  color: var(--tc-ink);
  scroll-margin-top: 70px;
}

.tc-doc-article h3 {
  margin: 24px 0 12px;
  font-size: 17px;
  font-weight: 600;
  color: var(--tc-ink);
  scroll-margin-top: 70px;
}

.tc-doc-article h4 {
  margin: 20px 0 10px;
  font-size: 15px;
  font-weight: 600;
  color: var(--tc-ink);
  scroll-margin-top: 70px;
}

.tc-doc-article ul,
.tc-doc-article ol {
  margin: 0 0 14px;
  padding-left: 22px;
}

.tc-doc-article li {
  margin-bottom: 6px;
}

.tc-doc-article blockquote {
  margin: 16px 0;
  padding: 14px 16px;
  background: #f2f7ff;
  border-left: 4px solid var(--tc-primary);
  color: #2c3648;
}

.tc-doc-article pre,
.tc-doc-article code {
  background: var(--tc-bg);
  border-radius: 3px;
  font-family: Menlo, Consolas, monospace;
  font-size: 13px;
}

.tc-doc-article pre {
  padding: 14px 16px;
  overflow: auto;
  border: 1px solid var(--tc-line);
}

.tc-doc-article code {
  padding: 1px 5px;
}

.tc-doc-article table {
  border-collapse: collapse;
  margin: 16px 0;
  width: 100%;
}

.tc-doc-article table th,
.tc-doc-article table td {
  border: 1px solid var(--tc-line);
  padding: 9px 12px;
  font-size: 13px;
  text-align: left;
}

.tc-doc-article table th {
  background: var(--tc-bg);
  font-weight: 600;
  color: var(--tc-ink);
}

/* 附件 */
.tc-doc-attachment {
  margin-top: 32px;
  padding: 16px;
  background: var(--tc-bg);
  border-radius: 4px;
}

.tc-doc-attachment-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--tc-ink);
  margin-bottom: 8px;
}

.tc-doc-attachment-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 20px 4px 0;
  font-size: 13px;
  color: var(--tc-primary);
  cursor: pointer;
}

.tc-doc-attachment-item:hover {
  text-decoration: underline;
}

/* 上一篇 / 下一篇 */
.tc-doc-pager {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid #f0f1f5;
}

.tc-doc-pager-item {
  max-width: 46%;
  font-size: 13px;
  color: #4e5969;
}

.tc-doc-pager-item > a {
  display: flex;
  align-items: center;
  gap: 6px;
  color: inherit;
  cursor: pointer;
  text-decoration: none;
}

.tc-doc-pager-item > a:hover {
  color: var(--tc-primary);
}

.tc-doc-pager-item span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* ===== 右侧本页目录 ===== */
.tc-doc-toc {
  position: sticky;
  top: 50px;
  width: 240px;
  flex-shrink: 0;
  max-height: calc(100vh - 50px);
  overflow-y: auto;
  padding: 28px 24px 32px 0;
  box-sizing: border-box;
}

.tc-doc-toc-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--tc-ink);
  margin-bottom: 12px;
}

.tc-doc-toc-item {
  position: relative;
  padding: 5px 0 5px 12px;
  font-size: 13px;
  line-height: 20px;
  color: #4e5969;
  cursor: pointer;
  border-left: 2px solid #f0f1f5;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.tc-doc-toc-item:hover {
  color: var(--tc-primary);
}

.tc-doc-toc-item.is-active {
  color: var(--tc-primary);
  border-left-color: var(--tc-primary);
}

.tc-doc-toc-level-2 {
  padding-left: 26px;
  font-size: 12px;
  color: var(--tc-muted);
}

/* ===== 窄屏适配 ===== */
@media screen and (max-width: 1200px) {
  .tc-doc-toc {
    display: none;
  }
}

@media screen and (max-width: 750px) {
  .tc-doc-page {
    flex-direction: column;
  }

  .tc-doc-side {
    position: static;
    width: 100%;
    height: auto;
    max-height: 320px;
    border-right: none;
    border-bottom: 1px solid var(--tc-line);
  }

  .tc-doc-main {
    width: 100%;
    padding: 20px 16px 40px;
  }

  .tc-doc-title {
    font-size: 22px;
  }
}

/* 文档请求错误独立显示，不继承宿主 rem 根字号。 */
.tc-doc-error {
  margin: 24px;
  padding: 16px;
  border: 1px solid #e4e7ec;
  background: #fafbfc;
  color: #475467;
  font-size: 14px;
  line-height: 24px;
  overflow-wrap: anywhere;
}
