/* 整体容器 */
.word-viewer-container {
  width: 100%;
  height: 100vh;
  box-sizing: border-box;
  padding: 20px;
  background: #f5f7fa;
  font-family: "Microsoft YaHei", sans-serif;
}

/* 文件上传区域 */
.upload-area {
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 15px;
}

.file-input {
  padding: 8px 12px;
  cursor: pointer;
}

.loading-text {
  color: #409eff;
  font-size: 14px;
}

.error-text {
  color: #f56c6c;
  font-size: 14px;
  margin: 0;
}

/* 核心左右布局 */
.main-content {
  display: flex;
  width: 100%;
  height: calc(100vh - 120px);
  gap: 20px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
}

/* 左侧目录菜单栏 */
.menu-sidebar {
  width: 280px;
  background: #fff;
  padding: 20px;
  box-sizing: border-box;
  overflow-y: auto;
}

.menu-title {
  margin: 0 0 15px 0;
  font-size: 18px;
  color: #333;
  border-bottom: 1px solid #eee;
  padding-bottom: 10px;
}

.menu-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.menu-item {
  padding: 8px 10px;
  margin-bottom: 4px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

/* 标题层级缩进：h1→0，h2→20px，h3→40px */
.level-1 {
  padding-left: 0;
  font-weight: 700;
  color: #333;
}

.level-2 {
  padding-left: 20px;
  color: #555;
}

.level-3 {
  padding-left: 40px;
  color: #777;
  font-size: 13px;
}

/* 目录激活高亮 */
.menu-item.active {
  background: #e6f7ff;
  color: #409eff;
}

.menu-item:hover {
  background: #f5f7fa;
}

/* 右侧文档内容区 */
.doc-content {
  flex: 1;
  background: #fff;
  padding: 30px;
  box-sizing: border-box;
  overflow-y: auto;
}

.empty-tip {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  font-size: 16px;
}

/* 解析后的HTML样式重置（适配mammoth的输出） */
.parsed-html {
  line-height: 1.8;
  font-size: 15px;
  color: #333;
}

.parsed-html h1,
.parsed-html h2,
.parsed-html h3 {
  margin: 24px 0 16px 0;
  color: #222;
  border-bottom: 1px solid #eee;
  padding-bottom: 8px;
}

.parsed-html p {
  margin: 12px 0;
  text-align: justify;
}

.parsed-html ul,
.parsed-html ol {
  margin: 12px 0;
  padding-left: 20px;
}

.parsed-html img {
  max-width: 100%;
  height: auto;
  margin: 20px 0;
}

.parsed-html table {
  border-collapse: collapse;
  width: 100%;
  margin: 20px 0;
}

.parsed-html td,
.parsed-html th {
  border: 1px solid #eee;
  padding: 8px 12px;
  text-align: left;
}